kproc
02-13-2007, 08:14 PM
hi the below statement returns this I have a similar statement that works but it has only one where clause.
$query_advance_ads = ("SELECT * FROM ads WHERE category = '$category' OR sub_category = '$sub_category' OR ad_type = '$ad_type' AND title LIKE '%$title%' order by '$sortBy' LIMIT $start, $end");
the message
SQL Error: SELECT * FROM ads WHERE category = '' OR sub_category = '' OR ad_type = '' AND title LIKE '%%' order by '' LIMIT ,
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
$query_advance_ads = ("SELECT * FROM ads WHERE category = '$category' OR sub_category = '$sub_category' OR ad_type = '$ad_type' AND title LIKE '%$title%' order by '$sortBy' LIMIT $start, $end");
the message
SQL Error: SELECT * FROM ads WHERE category = '' OR sub_category = '' OR ad_type = '' AND title LIKE '%%' order by '' LIMIT ,
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1