Re[2]: [PHP] OK SQL experts...
| From: | Richard Davey | Date: | Fri, 23 Apr 2004 16:28:01 +0000 |
| Subject: | Re[2]: [PHP] OK SQL experts... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184425@lists.php.net to get a copy of this message | ||
Hello Brian,
Friday, April 23, 2004, 5:02:00 PM, you wrote:
BD> Yes, I actually did exactly that. Everything works until I have more
BD> than one statement inside the (x LIKE x OR x LIKE x) parens. That's why
BD> I figured there has to be something wrong with my paren structure. When
BD> I RTFM I saw someplace to use {}+ instead of () but it gave a different
BD> error.
I don't think it's anything to do with your () placement, I just
tested and the follow 3 queries all bring back the same results:
SELECT * FROM table WHERE (field LIKE '%var%') OR (field2 LIKE
'%var%') AND field3 = 'condition'
SELECT * FROM table WHERE (field LIKE '%var%' OR field2 LIKE
'%var%') AND field3 = 'condition'
SELECT * FROM table WHERE field LIKE '%var%' OR field2 LIKE
'%var%' AND field3 = 'condition'
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html