Results 1 to 2 of 2
July 30th, 2004, 10:52 AM #1
I am trying to get a MySQL query to work but I'm just not getting it.
Here is what I have:
select * from $tablename Where (SUBCAT1 = \"$_GET[SC1]\" or SUBCAT2 = \"$_GET[SC2]\") and CATAGORY = \"$_GET[CAT]\"
I am trying to have it select records that match a "Catagory" and match either "SUBCAT1" or "SUBCAT2"
Make sense. Please Help.
July 30th, 2004, 11:01 AM #2
- Join Date
- January 17th, 2005
$sql = "SELECT * FROM $tablename WHERE CATAGORY='" . $_GET['CAT'] . "' AND (SUBCAT1='" . $_GET['SC1'] . "' OR SUBCAT2='" . $_GET['SC2'] . "');";
This assumes that "Catagory", "SUBCAT1" and "SUBCAT2" are all strings and not numbers (if they are numbers then remove the single quotes before the double quotes).<A HREF="http://www.affmarketing.org/">The Affiliate Marketing Blog</A>: Check out my latest entry on "Affiliate Marketing on a Dime"
By knight01 in forum Programming / Datafeeds / ToolsReplies: 9Last Post: May 9th, 2010, 09:16 PM
By sweetiowa in forum WebMerge (Fourthworld.com)Replies: 3Last Post: October 13th, 2007, 07:30 PM
By mobilebadboy in forum Programming / Datafeeds / ToolsReplies: 3Last Post: April 6th, 2006, 09:05 AM
By suzie250 in forum Programming / Datafeeds / ToolsReplies: 5Last Post: January 17th, 2006, 08:37 PM
By Doug247 in forum Programming / Datafeeds / ToolsReplies: 1Last Post: May 5th, 2004, 12:09 PM