hi...what's the right sql sentence if i would like to get all results of a table that begin with a peticular letter?
example : # A B C D E F ....., when i click on a letter i want all titles of books (example) that begins with an 'A'.
thanks.
[SOLVED] simple sql question
Moderator: General Moderators
-
mcog_esteban
- Forum Contributor
- Posts: 127
- Joined: Tue Dec 30, 2003 3:28 pm
just use ORDER BY
if you want to do the letter thingie, try something like this :
where $letter is the letter you click on..
Code: Select all
"SELECT books FROM mytable ORDER BY names";Code: Select all
"Select books from mytable where title like '".$letter."'%' ORDER by books";