Hey all,
I'm trying to generate a alphabetized list of items
from my database, but I want to alphabetize the list,
skipping the leading articles in the title for each item.

some solutions suggest creating a 2nd (dummy name) column
to alphabetize by, but I don't want to maintain two columns for
my name field. but I've been using the following to ignore 'the ' and 'a

$select = mysql_select_db("bases");
$query = "SELECT IF(left(nameE,2)='A ' or left(nameE,4)='The ', 
if(left(nameE,2)='A ',right(nameE,length(nameE)-2),
right(nameE, length(nameE)-4)),nameE) as 
alphabet,nameE FROM principle order by alphabet";
$result = mysql_query($query)

but if I want to ignore third or fourth variable, on top of 'the ' and 
'a ', what syntax would I use, to include these additional cases in my

the above query was built on a coding solution I found at
*mysql: select statements that ignore "the "*


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to