Jump to content

[SOLVED] Showing lastest posts/replies in forum


runnerjp

Recommended Posts

ok i cant figure this one out...

 

my table looks a little like this...

 

postid forum author title post showtime  lastposter numreplies parentid lastrepliedto

 

 

postid = id of post

forum= forum posted in

showtime= time of post

parentid = if post a reply then the parentid is the id of the post relied too..

lastrepliedto= time of last reply

 

 

my current code looks like this

 

<?php
session_start();
require_once '../settings.php';
$getthreads="Select * from forumtutorial_posts  ORDER BY showtime  DESC LIMIT 10";


$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]);?>

   <br>
  <b><?php echo $getthreads3[title]?> </b> <?php } ?>

 

but its here

<?php $getthreads="Select * from forumtutorial_posts  ORDER BY showtime  DESC LIMIT 10";?>

where my problem lies as if the reply is made in the top ten then there is no topic... so what should i order it by :S... if you are confused please say!

 

         

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.