I am trying to display table data using PHP however for an unknown reason the result I am getting is not what I expected. I am aiming to display a table with the data from the database inside it however I am instead seeing the table with the variable names inside but no data, and above the table I see the word echo
repeated. The code I am using is as follows;
<?php
//connect to database
mysql_connect('mysqlhost3', '40099609', 'ou2wareyido');
mysql_select_db('40099609');
$sql="SELECT * FROM gig";
$records=mysql_query($sql);
?>
<html>
<head>
<title> Gig Data </title>
</head>
<body>
<table width="600" border="1" cellspacing="1">
<tr>
<th> ID </th>
<th> Start Time </th>
<th> Name </th>
<th> Venue </th>
<th> Act </th>
<th> Img </th>
</tr>
<?php
while ($employee=mysql_fetch_assoc($records)){
echo "<tr>";
echo"<td>".$id['ID']."</td>";
echo"<td>".$start['Start Time']."</td>";
echo"<td>".$sname['Name']."</td>";
echo"<td>".$venue['Venue']."</td>";
echo"<td>".$act['Act']."</td>";
echo"<td>".$img['Img']."</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>
Can anyone see where I am going wrong ?