Jump to content

Picture Help Please


phpretard

Recommended Posts

This seems simple enough to me BUT...there are 10 images in the database and this will only display 1

 

Does anyone know why?

 

Oh please help me...(my eyeballs hurt)

 

<?php

include "connect.php";

    
$result = mysql_query("SELECT * FROM pictures");

while($row = mysql_fetch_array($result))

      { 
       $data = $row[bin_data]; 
       $type = $row['file_type']; 
       echo $data;
      } 
?>

Link to comment
Share on other sites

lets try a few things to make it better

<?php

include "connect.php";

    
$result = mysql_query("SELECT * FROM pictures") or die(mysql_error());
echo "Number of images: ".mysql_num_rows($result)."<br />";
while($row = mysql_fetch_array($result)){ 
       $data = $row[bin_data]; 
       $type = $row['file_type']; 
       echo $data."<br />";
      } 
?>

Link to comment
Share on other sites

THANK YOU FOR RESPONDING SO QUICKLY!

 

I can tell it is shows all of the pictures now BUT...

 

The picture is in binary code ???

 

 

Of course it's in a binary mode. You did nothing to convert it back.

 

A much better and simplier solution is that you upload all the files somwhere in dir and you store only the name of the picture in db.

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.