Jump to content

displaying entries in order


pouncer

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.