[SOLVED] mysql_query question
Posted: Wed Dec 24, 2003 3:21 pm
I'm trying to select names from a table that fit inside an alphbetical range. The code below seems to be working, but I'm wondering if there's a better way. Here's the code that I think selects all names that start with D or E:
Does case matter here? If I made the first condition (name>='D'), would that skip over a name of "davidson"?
For my second conditon (name<='Ez'), should I have used (name<'f')? I'm wondering if <='Ez' would skip over the name "Ezzy".
And that brings me to one last question (for now): how does PHP and/or MySQL order characters? Can anyone point me to a reference?
Thanks in advance!
(Edited : Infolock Moved to Database forum )[/b]
Code: Select all
$staffnames=mysql_query("SELECT name FROM $table WHERE name>='d' AND name<='Ez' ORDER BY name ASC");For my second conditon (name<='Ez'), should I have used (name<'f')? I'm wondering if <='Ez' would skip over the name "Ezzy".
And that brings me to one last question (for now): how does PHP and/or MySQL order characters? Can anyone point me to a reference?
Thanks in advance!
(Edited : Infolock Moved to Database forum )[/b]