Tandem Posted October 24, 2006 Share Posted October 24, 2006 Hi, i am drawing the names of cars out of my database. There are 6 different types of car and i want to put them in a specific order. I'm pretty sure i need to use a case statement to do this but i can't remember exactly how to do it as i need it, and when i google it i can't find anything that is similar to what i'm looking for.Can someone please demonstrate one for me?Thanks. Quote Link to comment Share on other sites More sharing options...
gmwebs Posted October 24, 2006 Share Posted October 24, 2006 [code]<?php$sql = "SELECT carname, make, model, color FROM cars ORDER BY carname ASC"; $result = mysql_query($sql, $conn);?>[/code] Quote Link to comment Share on other sites More sharing options...
Tandem Posted October 24, 2006 Author Share Posted October 24, 2006 Thats not what i mean at all.I am drawing them by name only. The order is not alphabetical, it is a specific order set by me. Quote Link to comment Share on other sites More sharing options...
trq Posted October 24, 2006 Share Posted October 24, 2006 [quote]The order is not alphabetical, it is a specific order set by me.[/quote]Then you should create an [i]orderby[/i] field in your database and order by that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.