Re: OK SQL experts...

From: Date: Fri, 23 Apr 2004 15:56:39 +0000
Subject: Re: OK SQL experts...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-184418@lists.php.net to get a copy of this message
I don't have access to the MySQL command line; it's hosted at my ISP. :( On Apr 23, 2004, at 8:54 AM, Mark wrote:
--- Brian Dunning <brian@briandunning.com> wrote:
Yes, I've checked and rechecked the spelling on everything. I've been testing with a word that I know appears in at least one of the fields.
I'm coming in a bit late, but have you tried echoing out the query variable contents and copying and pasting that to the MySQL command line? Also, any chance you could post the table decription?
On Apr 23, 2004, at 8:54 AM, Edward Peloke wrote:
what value is being put in the $keyword variable? You are sure
all
these columns exist? -----Original Message----- From: Brian Dunning [mailto:brian@briandunning.com] Sent: Friday, April 23, 2004 11:36 AM To: php-general@lists.php.net Subject: Re: [PHP] OK SQL experts... Backticks, single quotes, or nothing at all makes no difference.
I
believe the parsing error is due to my parentheses or AND/OR
structure.
Any thoughts on that? On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote:
From: "Brian Dunning" <brian@briandunning.com>
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';
Use backticks around table and column names, not single quotes. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
===== Mark Weinstock mark_weinstock@yahoo.com *************************************** You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing. *************************************** __________________________________ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - Brian


« previous php.general (#184418) next »