I'm using the following code to display rows from a MySQL table in a html table. I've already defined the table headers in the php - please can anyone advise how I modify the code to stop it bringing the MySQL column headings into the table as well?
Currently, it's displaying the table headings (row 1), then the MySQL column headings (row 2), before the records begin being displayed on row 3.
I've tried using -N at various points in the code to suppress the column headings, but it just throws an error.
<?php
// Create connection
$con = mysql_connect("localhost","xxxxxxxxxx","xxxxxxxxx");
// Check connection
if (!$con) {
die("Connection failed: " . mysql_error());
}
mysql_select_db("xxxxxxxxxxxx",$con);
$sql = "SELECT * FROM SiteList";
$myData = mysql_query($sql,$con);
echo "<table border=1>
<tr>
<th>ID</th>
<th>Site_Name</th>
<th>Weather_Forecast</th>
<th>Forecast_Date</th>
<th>Forecast_Time</th>
<th>Further_Information_about_This_Site</th>
</tr>";
while($record = mysql_fetch_array($myData)) {
echo "<tr>";
echo "<td>" . $record['ID'] . "</td>";
echo "<td>" . $record['Site_Name'] . "</td>";
echo "<td>" . $record['Weather_Forecast'] . "</td>";
echo "<td>" . $record['Forecast_Date'] . "</td>";
echo "<td>" . $record['Forecast_Time'] . "</td>";
echo "<td>" . $record['Further_Information_about_This_Site'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>