only first image is displayed
Posted: Sat Nov 29, 2008 6:17 pm
Hi,
What is the reason only the first image is displayed ?
and getimage.php
If I comment out 2 records are displayed so the SQL code is good.
Thanks
What is the reason only the first image is displayed ?
Code: Select all
$totalrows = total($make, $city);
echo '$totalrows = '.$totalrows;
echo '<TABLE border=0 cellPadding=2 cellSpacing=1 width=100%>';
echo '<tr align=left>
<th>Photo</th>
<th>Title</th>
<th>City</th>
</tr>';
if ($totalrows != 0)
{
$result = records($make, $city);
while ($row = mysql_fetch_row($result))
{
$id = $row[0];
echo '<tr align = left valign = top>';
echo '<td><img src="getimage.php?show='.$id.'width=150px; height=150px;/>';
echo '<td>'.$row[2].'</td>';
echo '<td>'.$row[1].'</td>';
echo '</tr>';
}
echo "</table>";Code: Select all
<?php
include("conectare.php");
$id = $_GET['show'];
$result = mysql_query("SELECT ext, photo
FROM photos
WHERE id_user = '$id '
and def = '1'");
if (mysql_num_rows($result) == 0)
{
echo 'no image';
exit;
};// die('no image');
list($ext, $data) = mysql_fetch_row($result);
// header('Content-Length: '.strlen($data));
header("Content-type: image/{$ext}");
// outputing image
echo $data;
// exit();
?>Code: Select all
echo '<td><img src=.... Thanks