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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.