Jump to content

Bit of re-ordering


doddsey_65

Recommended Posts

I have a query which pulls profile posts. This query sorts them via the date they were posted DESC. So newest ones are on top. However is a post has a comment i display the comment under the post. but the comments under the post are all ordered by DESC since it is one query to pull all of them. How would I order the comments in the reverse?

 

$sql = "SELECT f.*, u.u_uid, u.u_group_color, u.u_avatar
            FROM ".TBL_PREFIX."wall_feeds f
            JOIN ".TBL_PREFIX."users u
            ON (f.f_poster = u.u_username)
            WHERE f_uid = '$uid'
            AND f_pid = '$parent'
            ORDER BY f_time_posted DESC";

 

Link to comment
Share on other sites

It is not clear from your query where the comments are stored - or even if they are included in that query. I would think that the comments would be stored in a separate table with a reference back to the post. Are the posts and comments all stored in the wall_feeds table? If so, please provide the structure.

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.