PHP and MySQL: Order by most recent date and limit 10

前端 未结 6 1132
余生分开走
余生分开走 2020-12-11 15:13

I am building a notes system on my site and I\'ve got to the stage where users can post notes into the MySQL database using PHP and then PHP prints them out on a page. Howev

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-11 15:54

    This should do it :

    $result = mysql_query("SELECT * FROM notes WHERE note_author_id='$u_id' ORDER BY date_time DESC LIMIT 0, 10");
    

提交回复
热议问题