
July 4th, 2006
11:41 PM
Neverside Newbie
Status: Offline!
mysql wildcard
I want to use a WHERE mysql query with 2 wildcards. With one wildcard the following works fine:
SELECT id, point FROM ".TBL_PLAYERS." WHERE id like '3%' ORDER BY point DESC
but if I use
SELECT id, point FROM ".TBL_PLAYERS." WHERE id like '3%' AND '4%' ORDER BY point DESC
it returns the 4% part as comparative to the 3% part. I need them to be independant of one another but be still selected in the same query.

July 5th, 2006
01:37 AM
Neverside Newbie
Status: Offline!
You could try this:
SELECT id, point FROM ".TBL_PLAYERS." WHERE id like '3%' AND id like '4%' ORDER BY point DESC
or this:
SELECT id, point FROM ".TBL_PLAYERS." WHERE id like '3%' OR id like '4%' ORDER BY point DESC
Depending on what kind of result your looking for.
___________________
I don't suffer from insanity; I enjoy every minute of it.
Unintended Theory | Cacrew v4

July 5th, 2006
04:38 AM
Neverside Newbie
Status: Offline!
my bad, it works now. thanks ;D