次のようなmysqlのテーブルがあります:
| sq | date | title | description |
-----------------------------------
| 10 | 10-06| xxxx | blah blah |
| 09 | 10-06| xxxx | blah blah |
| 08 | 10-06| xxxx | blah blah |
| 07 | 10-06| xxxx | blah blah |
今私はsq(squence)の降順でphpを使って画面に表示したい。
次のコードを使用しましたが、エラーが表示されます。
$result = mysql_query("SELECT * FROM posts WHERE (SELECT MAX(sn) FROM posts)");
echo('<ul class="news">');
while($row=mysql_fetch_array($result)) {
$date=$row["date"];
$title=$row["title"];
$description=$row["description"];
echo "<li><strong>$date</strong><h4><a href='#'>$lastname</a></h4>$description</li>";
}
echo('</ul>');
エラーメッセージ:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\final\index.php on line 99
Call Stack
一度に 3 つずつ、他のユーザーを表示するためのリンクが表示されます。
前もって感謝します。