943,867 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 3263
  • PHP RSS
Jun 23rd, 2008
0

display image file from mysql databse using php

Expand Post »
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....
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
wuodpam is offline Offline
2 posts
since Jun 2008
Jun 24th, 2008
0

Re: display image file from mysql databse using php

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)
Reputation Points: 12
Solved Threads: 1
Newbie Poster
gpm1982 is offline Offline
6 posts
since Feb 2008
Jun 24th, 2008
0

Re: display image file from mysql databse using php

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
 
Reputation Points: 10
Solved Threads: 0
Newbie Poster
wuodpam is offline Offline
2 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Would the file size affect the upload?
Next Thread in PHP Forum Timeline: help, the browser gives an error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC