forum, post odering

Discussion in 'PHP' started by tldmic, Apr 4, 2010.

  1. #1
    Hi all,
    I am back again with a little problem.

    I have a forum of which I want it to display the posts in accordance to the new post on top. I have been trying to fix it and I had been having problems,

    here is the extracted parts from each file relevent to the problem.
    In the forum display table,I have


    POST.PHP
    $insertpost="INSERT INTO forum(author,title,post,showtime,realtime,lastposter) values('$name','$subject','$yourpost','$displaytime','$thedate','$name')";


    FORUM.PHP
    $getthreads="SELECT * from forum where parentid='0' order by lastrepliedto desc limit 0,27";

    MESSAGE.PHP
    $getreplies="Select * from forum where parentid='$id' order by postid desc"; //getting replies


    the file message.php, diplays the listing properly whereas the forum.php gives me problems in terms of ordering the posts. Is there a simplier way to resolve this,

    any help
     
    tldmic, Apr 4, 2010 IP
  2. Freditpl

    Freditpl Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,
    SELECT * from `forum` where `parentid`='0' order by `lastrepliedto` desc limit 0,27
    PHP:
    I suppose problem in `lastrepliedto` field .
    What format value do you use in this fields ? (TIMEDATA, VARCHAR etc )
     
    Freditpl, Apr 4, 2010 IP
  3. tldmic

    tldmic Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i use Bigint(20), thank you
     
    tldmic, Apr 5, 2010 IP