pouncer Posted February 18, 2007 Share Posted February 18, 2007 I have a table called forum_name with these fields forum_id (primary key) user_id (user id of admin who made the new discussion forum) forum_name forum_description Basically, I've just made a simple form for the admin to fill in a new forum name and descriptino and it inserts it into the database on those fields. However, what i need help on, is the ordering. I want to be able to change the order in which i display the discussion forums. e.g, if i made a forum for 'cars' then another forum for 'interests' this will display on the forums page cars interests how could i swap the order so it displays interests cars could someone show me a solution as to how i can do it please? Quote Link to comment Share on other sites More sharing options...
hvle Posted February 18, 2007 Share Posted February 18, 2007 ...order by forum_name desc Quote Link to comment Share on other sites More sharing options...
pouncer Posted February 18, 2007 Author Share Posted February 18, 2007 i don't get it. how would i change the order in the first place, on the php page. Quote Link to comment Share on other sites More sharing options...
hvle Posted February 18, 2007 Share Posted February 18, 2007 as my understanding, the forum names are grabbed from database. in your query, put order by forum_name desc to make it arrange the forum name in reverse order. like this: $sql = "select * from table order by forum_name desc limit 5"; just an example of how to use order by 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.