display image file from mysql databse using php

Please support our PHP advertiser: 50% off 6 Months Dedicated Server Hosting from 1&1!
Reply

Join Date: Jun 2008
Posts: 2
Reputation: wuodpam is an unknown quantity at this point 
Solved Threads: 0
wuodpam wuodpam is offline Offline
Newbie Poster

display image file from mysql databse using php

 
0
  #1
Jun 23rd, 2008
I'm having a problem with displaying my profile images from a database .the upload works fine,but no image is displayed:Could you please help!

I have the following code which cant work:

1. main profile page has the following script:

<?php echo '<img src="XXXXX_XXX.php?id=$Current_Person_Id">';

---------------------------------------------------------------------------------

2.the image page has the following script:
$result = mysqli_query($link,"select * from person where Person_Id='1

$result = mysqli_query($link,"select * from XXX where Person_Id='$Current_Person_Id'");

////starting the inner validation

//else if($result){

$row_count=0;

while($row = mysqli_fetch_array($result))
{
//$row_color = ($row_count % 2) ? $color1 : $color2;
$content=$row['Photo_Content'];
$name=$row['Photo_Name'];
$type=$row['Photo_Type'];
$size=$row['Photo_Size'];
$row_count++;
}
header("Content-lengthsize");
header("Content-typetype");
header("Content-Disposition: inline; filename=$name");
//header('filename=$name');
//Content-Disposition: attachment;
echo $content;




Note:

The variablessize,$type,$name are stored in database too.
I'm able to print all of them except the content.
Could it be my php configuration orsomething to do with images?

I've attached the image icon displayed..here....
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 6
Reputation: gpm1982 is an unknown quantity at this point 
Solved Threads: 1
gpm1982 gpm1982 is offline Offline
Newbie Poster

Re: display image file from mysql databse using php

 
0
  #2
Jun 23rd, 2008
Try running the image script in a separate page (the image link) and see if there's any error message pops up.
If you don't see any error, configure php.ini to display_error=On and then try again (after restart apache)
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 2
Reputation: wuodpam is an unknown quantity at this point 
Solved Threads: 0
wuodpam wuodpam is offline Offline
Newbie Poster

Re: display image file from mysql databse using php

 
0
  #3
Jun 24th, 2008
An X icon is displayed but not the actual image...

I've attached a copy of a "snag it" web view of the display page alone..
Attached Images
 
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum


Views: 2497 | Replies: 2
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC