retrieving images from mysql

From: Date: Thu, 28 Jun 2001 15:27:19 +0000
Subject: retrieving images from mysql
Groups: php.db 
Request: Send a blank email to php-db+get-9936@lists.php.net to get a copy of this message
I have a strange problem and was wondering if anyone had an idea of what was going on. I have a php script that displays images I place in a database. The reason I place the images in a database is because it simplifies things and the performance of the database itself is not an issue for this project. But anyway, I retrieve the image and everything goes fine. But the next time I try to retrieve it, nothing happens. The page just loads and loads indefinetly. Here's my code (that works.. but only once a day though :/ ) <? require_once("db_lin.php"); if (!$conn = db_connect()) { echo "can't connect to database"; return; } $get_image_result = mysql_query("select image from images where directory = '$fp' "); $myImage = @mysql_result($get_image_result, 0, "images") OR die ("database error"); Header("Content-Type: image/png"); echo ($myImage); mysql_close(); ?> my guess is that there's just something wrong with the database or something (the database is on the same machine as the script). but if anyone has any ideas about how to solve this I'd appreciate it. -petur

« previous php.db (#9936) next »