Hey all...
I have a PHP page querying a MySQL database for a list of articles (and related information).
Here is that PHP:
It works fine...but not exactly how I'd like it to.PHP Code:<?
$id=$_REQUEST['id'];
$sql="select * from fiction where id=$id";
$result=mysql_query($sql);
while($rs=mysql_fetch_array($result))
{
?>
<div class="featured">
<span class="h7"><?=$rs['title'];?></span><br />
<img src="cms/upload/<?=$rs['image'];?>"><br />
<span class="h8"><?=$rs['content'];?></span>
</div>
<?
}
?>
It displays the entries (made through a backend) in the order they were entered (i.e. the newest entry is at the bottom). I'd like to reverse this so the newest entry is at the top.
I know I have to change the SQL query but don't know enough PHP to know how to. Can someone help me out here?



Reply With Quote

Bookmarks