I have read and read about mysql, which I am sure is just like the quoted, "linux is very friendy, but it just chooses who it wants to be friends with..."
My first attempt to read the database in my forum actually works! Well, almost. It does query the correct places, lists the information, and I have even figured out how to see a full path to where the photo is stored.
But is never actually SHOWS the image.
My eventual goal is to simply input a member id# and it will list all of the photo attachments by that member.
Right now I would settle for it to work by displaying the photos found, (which does actually shows the path now, but not as a link or photo.) src and all that simply does not work, header ("Content-type: image/jpeg"); print $imagebytes;, fails as well, at least in any way I have tried.
any help would be apprecitated!
My first attempt to read the database in my forum actually works! Well, almost. It does query the correct places, lists the information, and I have even figured out how to see a full path to where the photo is stored.
But is never actually SHOWS the image.
My eventual goal is to simply input a member id# and it will list all of the photo attachments by that member.
Right now I would settle for it to work by displaying the photos found, (which does actually shows the path now, but not as a link or photo.) src and all that simply does not work, header ("Content-type: image/jpeg"); print $imagebytes;, fails as well, at least in any way I have tried.
Code:
<?
$username="MyUserName";
$password="MyPassWord";
$database="MyDataBase";
$x=date("j");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM ibf_attachments";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>Database Output</center></b><br><br>";
$i=0;
while ($i < $num) {
$member=mysql_result($result,$i,"attach_member_id");
$isimage=mysql_result($result,$i,"attach_is_image");
$imagedate=mysql_result($result,$i,"attach_date");
$imagesize=mysql_result($result,$i,"attach_filesize");
$imagewidth=mysql_result($result,$i,"attach_img_width");
$imageheight=mysql_result($result,$i,"attach_img_height");
$imagelocation=mysql_result($result,$i,"attach_location");
// this sets the image location to a full path
$full_location = "http://www.MySite.com/forum/uploads/$imagelocation";
echo "<b>$member $isimage</b><br>
Image Date: $imagedate<br>
Image Size: $imagesize<br>
Image Width: $imagewidth<br>
Image Height: $imageheight<br>
location: $imagelocation <br>
<br><br>
// this actually shows the link, but not clickable, nor will it display image here.
// I can copy and paste it in browser and it is correct path.
full location: $full_location<br>
<hr><br>";
?>
<?PHP
$i++;
}
?>
any help would be apprecitated!
Comment