Jump to content

Recommended Posts

Hi guys,

On my message board it is suppose to post the new topic at top, well it does that, but then when there is about two more it starts posting the topics in the middle of the board, I am not too sure why.

 

here is how it orders:

$getthreads="SELECT * from forum where parentid='0' order by lastrepliedto ASC";

 

here is the whole code:

<?php 
include "connect.php"; //mysql db connection here
print '<div class="box">';


if($session->logged_in){
print "<link rel='stylesheet' href='style.css' type='text/css'>";

print "<p align='right'><A href='post.php'><img src='img/topic.png' border='0' alt='New Topic' /></a><br></p>";

print "<table class='maintable'>";

print "<tr class='headline'><td width=50%>Topic</td><td width=20%>Topic Starter</td><td>Replies</td><td>Last replied time</td></tr>";

$getthreads="SELECT * from forum where parentid='0' order by lastrepliedto ASC";

$getthreads2=mysql_query($getthreads) or die("Could not get threads");

while($getthreads3=mysql_fetch_array($getthreads2))

{

  $getthreads3[title]=strip_tags($getthreads3[title]);

  $getthreads3[author]=strip_tags($getthreads3[author]);

  print "<tr class='mainrow'><td><A href='message.php?id=$getthreads3[postid]'>$getthreads3[title]</a>";

  print "</td><td align='center' valign='middle'><a href='../userinfo.php?user=$getthreads3[author]'>$getthreads3[author]</a></td><td align='center' valign='middle'>$getthreads3[numreplies]</td><td>$getthreads3[showtime]<br>Last post by <b><a href='../userinfo.php?user=$getthreads3[lastposter]'>$getthreads3[lastposter]</a></b></td></tr>";

}
print "</table>";
print "<p align='right'><A href='post.php'><img src='img/topic.png' border='0' alt='New Topic' /></a><br></p>";
}else{
include ("../../style/include/cons/member.php");
}
print '</div>';
include ("../../style/include/cons/foot.php");
?>  

 

does anyone see where my problem is?

 

Thanks guys!

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.