Code: Select all
Warning: Supplied argument is not a valid MySQL result resource in /var/www/html/projects/photos/photos.php on line 19Code: Select all
<?php
$user = 'blahuser';
$pass = 'blahpass';
$db = 'pictures';
$conn = MYSQL_CONNECT("localhost",$user,$pass);
mysql_select_db($db,$conn);
$sql = "SELECT description,section FROM $table WHERE id=$id";
$result = mysql_query($sql,$conn) or die(mysql_error());
while ($newarray = mysql_fetch_array($result)) {
$description = $newarray['description'];
$section = $newarray['section'];
}
for ($id = 1; $id <= $mysql_num_rows($result); $id++ ) {
print '<TR>';
print '<TD width=33\%><img src=getdata.php?id='.$id.'&table='.$table.'width=404 height=295></TD>';
print '<TD width=33\%>'.$description.'</TD>';
print '<TD width=33\%>'.$section.'</TD>';
print '</TR>';
}
?>
</TABLE>Thanks,
-Steve