cloudbird Posted October 15, 2010 Posted October 15, 2010 Expert: My Advance search is not working. I have looked the forum for similar kind of thread but couldn't find the resolution of my problem. All the desired fields are getting field in the query string but it's still throwing the following exceptions: 1064 - 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 select * from categories_description where categories_id = Any guidelines would be deeply appreciated. Implementation: oscommerce-2.2rc2a With Thanks! Cloud Bird
MrPhil Posted October 15, 2010 Posted October 15, 2010 It would help if you gave the file and line the error is reported on. I can't find that particular query anywhere. Do you have any add-ons that might contain this query? Is that the complete SQL statement? Obviously it's missing the category ID value to compare against. The PHP code would be something like ...mysql_query("select * from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id='" . $cat_id . "';"); You need to find the PHP code that produces the query, and see why the '...variable name...' was cut off. Possibly it was a bad add-on installation, or filesystem troubles that truncated a line (although it's odd in such a case that there was no PHP error about an unterminated string). Maybe it's poorly written code that has no single quotes around the value, and the variable is undefined or empty. If this is an add-on, is it using register global variables (possibly shut off on your server)? That could account for there being no value there. You would have to trace back to see how that value is coming into the script -- is it being passed from a form or another page using a register global instead of a proper GET or POST element?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.