I have table in mysql like follow:
| 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 |
Now I want to display them in screen using php in descending order of sq(squence).
I used the following code but its showing an error:
$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>');
The error message:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\final\index.php on line 99
Call Stack
And three at a time with a link to show others.
Thanks in advance.