Jump to content

display images <img src =\"" . $row['user_image']."\">


johnseito

Recommended Posts

Hello all,

 

People say that this code is suppose to work:

 

while($row = mysql_fetch_array($query)) { 
echo "<tr>"; 
echo "<td><img src =\"" . $row['user_image']."\"></td>";  
echo "</tr>";

 

it should bring out all your images/photo.

 

I tried this code and no photo appear, just the icon, and when you upload one photo it seems that 3 icon will pop out as if there is 3 photo for every upload.

 

but when I do it like this,

Code:

$row = mysql_fetch_assoc($query);

$bytes = $row[imgdata];
$row = mysql_fetch_assoc($query);

$bytes = $row[imgdata];
<center><img src=?gim=1 width=1000 height=1000><br> <!--144-->

it works but it only brings out one photo. I want it to bring out all photo, imgdata is the field in mysql that stores the pictures.

 

any help would be great.

 

thankst

Link to comment
https://forums.phpfreaks.com/topic/91530-display-images/
Share on other sites

Ok, thanks for your response. 

 

I created a table in MySQL called pix like this:

 

Create table pix (
Pid int primary key not null auto_increment, 
Title text,
Imgdata longblob);

 

I know how to store the photo correctly into the pix table, but I couldn’t get all the uploaded photo out.  I could only get one, the lastest one uploaded.  And I couldn’t upgrade the code to do just that because of this: 

 

if ($_REQUEST[gim] == 1) {
header("Content-type: image/jpeg");
print $bytes;
exit ();

}

 

<img src=?gim=1 width=1000 height=1000><br>

The gim==1 is what determines the photo to appear.  I don’t know why is it gim ==1.  So could you tell me why is src gim =1 or how I can change this code to show all photo uploaded instead of just 1. 

 

Thanks -

 

Link to comment
https://forums.phpfreaks.com/topic/91530-display-images/#findComment-468873
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.