I am trying to run a query on getting the last 9 entries from the database, something simple I did in text, but trying to do it in a table form seems to mess it up. Here is my query code:
<?
$con = Omitted
// create query
$query = "SELECT * FROM libvid ORDER BY title DESC LIMIT 9";
// execute query
$result = mysql_query("SELECT * FROM libvid ORDER BY title DESC LIMIT 9");
// see if any rows were returned
if (mysql_num_rows($result) > 0) {
// yes
// print them one after another
echo "<table border='0'>";
echo "<tr>";
$col=0;
while($row = mysql_fetch_row($result)) {
$col++;
print '
<td width="170px" height="130px">
<font size="-3"><strong>'. $row['title'].'</strong></font><br>
<a href="#'.$row['title'].'" onClick="javascript:loadwindow(\'popup.php?id=' .$row['id']. '\')">
<img class="imgb" style="border: 2px solid black; border-radius: 30px; -moz-border-radius: 30px;-khtml-border-radius: 30px; -webkit-border-radius: 30px;" src=http://i3.ytimg.com/vi/'.$row['emurl'].'/0.jpg width="162" height="110" />
</a>
</td>';
if($col % 3 ==0) print '</tr><tr>';
} //end foreach $newarr
print '</tr></table>';
}
?>
I am getting the resource id #13 error and will not display anything