Click to See Complete Forum and Search --> : error


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

NightShift58
02-13-2007, 09:27 PM
It seems that none of your variables have been properly initialized.

kproc
02-13-2007, 09:33 PM
Thanks for the pointer, my other post states all the code and ties into this problem