Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

96 users online



mysql wildcard

mysql wildcard

Currently viewing this thread: 1 (0 members and 1 guests)


sapphire

sapphire

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.

Kickboy

Kickboy

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

sapphire

sapphire

Neverside Newbie
Status: Offline!

Doesn't work ;(

sapphire

sapphire

Neverside Newbie
Status: Offline!

my bad, it works now. thanks ;D

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.006 seconds.