On Apr 23, 2004, at 10:13 AM, John Nichel wrote:
Brian Dunning wrote:
I STFW and RTFM and I still can't figure out why this returns a 1064 parse error:
SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'active';
Anyone? TIA!
- B1ff Lamer
What does mysql_error() tell you?
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 ''my_table' WHERE ('field_1' LIKE '%%' OR 'field2'
I think this has been mentioned already, but your field names shouldn't have quotes around them. You should be using back ticks.
-- *********************************************************************** * _ __ __ __ _ * John Nichel * * | |/ /___ __ \ \ / /__ _ _| |__ ___ __ ___ _ __ * 716.856.9675 * * | ' </ -_) _` \ \/\/ / _ \ '_| / /(_-<_/ _/ _ \ ' \ * 737 Main St. * * |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150 * * |___/ * Buffalo, NY * * http://www.KegWorks.com [EMAIL PROTECTED] * 14203 - 1321 * ***********************************************************************
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php