Has anyone got an idea on how to show multiple images stored in a table, the images have a field which I use to reference them from my webpage
'modelid'
Except after planning the webpage and upload form, I now need to display the image/s, and I use modelid to query the database
id modelid name type size content
42 11 P10000222.jpg image/jpeg 58618 [BLOB - 57.2 KB]
44 11 P1000022.jpg image/jpeg 514344 [BLOB - 502.3 KB]
The display script I have will only show one image:
$query = "SELECT name, type, size, content " .
"FROM upload WHERE modelid = '$id'
LIMIT 0 , 3";
$result = mysql_query($query);
$number = mysql_numrows($result);
{
for ($i=0; $i<$number; $i++) {
$content=mysql_result($result,$i,"content");
$size=mysql_result($result,$i,"size");
$type=mysql_result($result,$i,"type");
echo $content;
To get the image:
print "<img src=\"/formshow.php?id=$id\" width=\"55\">";