For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > June 2006 > Picky MySQL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Picky MySQL
Andy George

2006-06-17, 8:10 am

$query="SELECT * FROM table where the first name starts with $letter";

How would you do this?

Want all the entries in database, that all the $name starts with "A",
for example...
mick white

2006-06-17, 8:10 am

Andy George wrote:

> $query="SELECT * FROM table where the first name starts with $letter";
>
> How would you do this?
>
> Want all the entries in database, that all the $name starts with "A",
> for example...

"SELECT * FROM table where column_name like 'A%'";

Not case-sensitive.
Mick
Andy George

2006-06-17, 8:10 am


> "SELECT * FROM table where column_name like 'A%'";



....works a treat, cheers muchly...
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com