View Single Post
Old 02-21-2013, 01:41 AM   PM User | #9
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,247
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Quote:
Originally Posted by SlayerACC View Post
and DEBUG SQL:
Code:
ArrayDEBUG SQL: Resource id #15
Pardon me, but that's impossible if you actually used the code I showed.

In my code $sql is nothing but a string. That looks like you echoed the $result.

And if the OR version worked, the AND version should work, too. But only if you actually had some data that matched the condition! In the $pattern that you showed:
Code:
## LIKE '%new%' AND ## LIKE '%old%'
that would mean that one of the tested fields has to contain *BOTH* "new" and "old".

As I said, it depends on what you want.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote