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
https://forums.phpfreaks.com/topic/86916-picture-help-please/
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
https://forums.phpfreaks.com/topic/86916-picture-help-please/#findComment-444356
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
https://forums.phpfreaks.com/topic/86916-picture-help-please/#findComment-444366
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.