I am getting absolutely nothing to display except the empty html table in the below code. I have executed the same query in phpmyadmin and gotten results, so I don't know what the difference is. Any suggestions on how I can troubleshoot it?
Code: Select all
<?php
// Create connection
$con = mysql_connect("localhost","user","passwd");
// Check connection
if (!$con)
{
echo "Failed to connect to MySQL: " . mysql_error();
}
mysql_select_db("database", $con);
$sqlstr = "SELECT `title`,`description`,`location` FROM `recordings` LIMIT 0, 30";
$result = mysql_query($sqlstr) or die($sqlstr."<br/><br/>".mysql_error());
echo "<table border='1'>
<tr>
<th>Title</th>
<th>Description</th>
<th>Listen</th>
</tr>";
while($row = mysql_fetch_array($result));
{
echo "<tr>";
echo "<td>" . $row['title'] . "</td>";
echo "<td>" . $row['description'] . "</td>";
echo "<td>" . $row['location'] . "</td>";
echo "</tr>";
}
mysql_close($con);
?>