我想通過DESC訂購我網站的新聞欄目,以便我可以先顯示最近的帖子,但是當我添加ORDER BY DESC時,出現此錯誤:mysql有問題ORDER
警告:mysql_fetch_assoc()期望參數1是資源,在83行C:\ xampp \ htdocs \ DeathRace \ site \ index.php中給出的布爾型
我不確定爲什麼我收到此錯誤,但這是非常不方便的,如果任何人都可以幫助我,它將不勝感激,這是我試圖循環的代碼:
$getnews = mysql_query("SELECT * FROM news LIMIT 0, 5 ORDER BY DESC id");
$per_page = 5;
while($row = mysql_fetch_assoc($getnews))
{
$id = $row['id'];
$title = $row['title'];
$body = $row['body'];
$date = $row['date'];
$postedby = $row['postedby'];
echo
"
$title posted on" .date('d-m-Y' ,strtotime($date))."$body By user: $postedby <br/>
";
}
線83是while循環 – 2011-03-02 23:37:02