mc_keny Posted February 11, 2008 Share Posted February 11, 2008 hey guys hears the thing i make a forum and its working and every thing i need a lil help though i want when a user post in a topic the topic move up says its way down the bottom and you post in it, it come to the top Link to comment Share on other sites More sharing options...
boen_robot Posted February 11, 2008 Share Posted February 11, 2008 When you query all the forums, sort them by date. You do store all topics with their creation time, right? Link to comment Share on other sites More sharing options...
Synook Posted February 11, 2008 Share Posted February 11, 2008 Have another column for last_post_time, which is updated every time someone posts. Then sort according to that column. Link to comment Share on other sites More sharing options...
mc_keny Posted February 11, 2008 Author Share Posted February 11, 2008 yeah i did that so your saying when a user post just update the creation date for the topic? if so whats the query for ordering them by date? eg mysql_query("SELECT id,name FROM mc_topic WHERE fid='".$did."' ORDER BY date_cr DESC");? Link to comment Share on other sites More sharing options...
djkdra Posted February 11, 2008 Share Posted February 11, 2008 Can do it like this (change names etc to your own codes): | Topic | Poster | Last Poster | Posted date | Last post date |<?php $forum=mysql_query("SELECT * FROM forum WHERE forumname='$_GET[forumname]' ORDER BY lastpostdate DESC");while($forumfetch=mysql_fetch_object($forum)){echo"| $forumfetch->title | $forumfetch->poster | $forumfetch->lastposter | $forumfetch->datemade | $forumfetch->lastpostdate |}?> hope that helps and works ...- DJKDra Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.