Images from MySQL Not Displaying

I’m recently having difficulty with my image pages. Everything has been working perfectly until recently and I’m not sure I did anything since I haven’t messed with the code. If anyone has any suggestions, I thank you very much in advance for any tidbits.

Here is how I’m calling the page:
catalog

Here are sample issues:
http://www.izzytees.com/viewcatalog.php
http://www.izzytees.com

Here is the view_image.php code:
[php]

<?php if($id) { $cat = $_REQUEST['cattype']; $id = $_REQUEST['id']; // you may have to modify login information for your database server: @MYSQL_CONNECT("xxx","xxx","xxx"); mysql_select_db("xxx"); $query = "select bin_data,filetype,display_id,cat_type from image_display where display_id='$id' AND cat_type='$cat'"; $result = @MYSQL_QUERY($query); $data = @MYSQL_RESULT($result,0,"bin_data"); $type = @MYSQL_RESULT($result,0,"filetype"); Header( "Content-type: $type"); echo ($data); }; ?>

[/php]

[size=99px]**Mod edit - Added PHP tags for readablity.[/size]

Well, from the link you provided, that error is telling me you are missing or the path to a page named main is wrong.

try to handle mysql errors:
[php]
$result = @MYSQL_QUERY($query);
if (mysql_errno())
die(FILE.LINE.mysql_error());
[/php]

I reviewed your live example (http://www.izzytees.com/view_image.php?cattype=pt&id=1) and didn’t saw changed header.
So, try to see $type and $data values with var_dump().

Images is stored in binary MySQL fields.

Why would you want to store the images in the database? It is much easier to store them on the filesystem (much easier to serve as well).

Resons:
problems with permission
quotas

Sponsor our Newsletter | Privacy Policy | Terms of Service