alright i have a partially working news system\engine\whatever, and ive run into the problem where i don't know how to get the newest news to be on top =\ so could someone pleaaase telle me how i would make the news list from newest to oldest.
here is the code all help would be great!
<?
$db = mysql_connect("localhost");
mysql_select_db("pnm",$db);
$sql="SELECT * FROM pnm_news";
$result=mysql_query($sql,$db);
$num = mysql_num_rows($result);
$cur = 1;
while ($num >= $cur) {
$row = mysql_fetch_array($result);
$title = $row["title"];
$author = $row["author"];
$date = $row["date"];
$story = $row["story"];
$sum = $row["summary"];
$sid = $row["sid"];
print("<table width=\"500\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"20\" valign=\"top\" height=\"20\" background=\"style\chrome\gray\img1.gif\"> </td>
<td width=\"460\" valign=\"middle\" background=\"style\chrome\gray\img2.gif\">
<font face=\"arial\" size=\"1\">
$title
</font>
</td>
<td width=\"20\" valign=\"top\" background=\"style\chrome\gray\img3.gif\"> </td>
</tr>
<tr>
<td height=\"20\" colspan=\"3\" valign=\"middle\">
<font size=\"1\">
<div align=\"right\">
<u>Added</u>: $date |
<u>Author</u>: $author
</div>
</font>
</td>
</tr>
<tr>
<td class=\"chrome\" width=\"500\" colspan=\"3\" valign=\"middle\" style=\"padding:2px;\">
<font size=\"1\">
<div align=\"left\">
$sum
</div>
</td>
</tr>
<tr>
<td height=\"20\" colspan=\"3\" valign=\"top\">
<font size=\"1\">
<div align=\"right\">
<a href=\"archive\view.php?id=$sid\"> Read More.. </a>
|
<a href=\"system/addcomments.php?id=$sid\"> Add Comment </a>
|
<a href=\"system/comments.php?id=$sid\"> Read Comments </a>
|
<a href=\"system/print.php?id=$sid\"> Printer Frienly Version </a>
</div>
</font>
</td>
</tr>
</table>");
$cur++;
}
?>