Need query help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phpashok
Forum Newbie
Posts: 1
Joined: Mon May 10, 2010 6:29 am

Need query help

Post by phpashok »

Hi friends...

I need a query help...

I wanna get the names from the username field of mysql database which is starting with 'S' (or any letter)...
whats the query for that??
query using LIKE fetches also the names containing 'S' which is not the starting letter of the name...

So please assist me to solve the problem...

Thanks in advance...
Ashok
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Need query help

Post by Eran »

use a wildcard only on the right side of 's'

Code: Select all

username LIKE 's%'
Post Reply