God this is so simple but I can't see what is wrong.
I've set up a dummy table with 2 entries, and want to return the records contained within the database.
I'm using the code below but only returning 1 record!
// SQL query
$sql = "SELECT date, title, news FROM news1 ORDER BY date DESC";
// Execute SQL and exit if failure
$sql_result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($sql_result);
while($row = mysql_fetch_array($sql_result)){
echo "<table width=\"100%\">";
echo "<tr>";
echo "<td>";
echo ReconstructDate($row['date']) . " - ". $row['title'];
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>" .$row['news']. "</td>";
echo "</table>";
}
I should also add that if I echo mysql_num_rows I return 2 rows, so I guess the problem is with how I am trying to iterate through the recordset.