howdy ya'll
i am stuck on returning multiple row results from my news database. what i have setup is a db for my news. there can by any amount of rows in the db but i only want it to return the 5 newest rows that's been inputed. heres what i am trying to do:
$query = "SELECT name, date, title, news FROM wpack_news ORDER BY id DESC LIMIT 5";
$result = mysql_query ($query, $link);
$num_results = mysql_num_rows ($result);
$row = mysql_fetch_array ($result);
for ($i=0; $i < $num_results; $i++) {
echo "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"400\" align=\"center\"> \n";
echo "<tr><td colspan=\"2\"> ".($row['title'])." </td></tr> \n <br>";
echo "</table> \n<br>";
}
for some reason, that only returns the very last row in my db and echo's it 5 times. :. now i have more then just a title in the db, from my $query you will see i am trying to retrive; name, date, title and news. i need to beable to reference the title or the date or the name by itself so that when i format the html table i can use ($row['title']) and be able to place that information where i want in my html table.
any ideas?
thanks kindly.