Gubbins Posted April 14, 2010 Share Posted April 14, 2010 Hi, This piece on sql ends up putting a new topic on the last page, is there anychance it can be altered so that a new topic is on the first page? $query = mysql_query("SELECT * FROM topics WHERE forum = '$forum' ORDER BY `s` DESC, lastreply DESC LIMIT $forum_look , $forum_count")or die("Couldn't get topics:" .mysql_error()); $num = mysql_num_rows($query); Link to comment https://forums.phpfreaks.com/topic/198553-new-topic-ends-up-on-the-last-page/ Share on other sites More sharing options...
aeroswat Posted April 14, 2010 Share Posted April 14, 2010 Hi, This piece on sql ends up putting a new topic on the last page, is there anychance it can be altered so that a new topic is on the first page? $query = mysql_query("SELECT * FROM topics WHERE forum = '$forum' ORDER BY `s` DESC, lastreply DESC LIMIT $forum_look , $forum_count")or die("Couldn't get topics:" .mysql_error()); $num = mysql_num_rows($query); Not very descriptive what is s? and what values does lastreply hold? Link to comment https://forums.phpfreaks.com/topic/198553-new-topic-ends-up-on-the-last-page/#findComment-1041923 Share on other sites More sharing options...
merylvingien Posted April 14, 2010 Share Posted April 14, 2010 ORDER BY ASC Link to comment https://forums.phpfreaks.com/topic/198553-new-topic-ends-up-on-the-last-page/#findComment-1041924 Share on other sites More sharing options...
Gubbins Posted April 14, 2010 Author Share Posted April 14, 2010 ORDER BY ASC Spot on mate, cheers Link to comment https://forums.phpfreaks.com/topic/198553-new-topic-ends-up-on-the-last-page/#findComment-1041951 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.