Jump to content

[SOLVED] Select beginning


dreamwest

Recommended Posts

Im trying to select rows base on a letter a. So i need to select all rows starting with the letter a

 

id  |  column

1  | apple

2  | bannana

3  | orange

etc

 

So i need a query that will only select id 1 which starts with the letter a

 

This searches for a in the whole string

$search = "a";
$sql = "SELECT * FROM tags where (tag like '%".$search."%') order by tag DESC limit 10";

Link to comment
https://forums.phpfreaks.com/topic/160736-solved-select-beginning/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.