get image from blob in mysql

From: Date: Sat, 26 Jan 2002 12:49:43 +0000
Subject: get image from blob in mysql
Groups: php.general 
Request: Send a blank email to php-general+get-82209@lists.php.net to get a copy of this message
List, I'm using the following code to retrieve image from Mysql. My problem is how can I output another image if the given ID doesn't have an image on it??? I had already inserted a blank gif in the database in order to use it, but I've tried to check if ($resultado['Imagem_data'] == "") or null and outputs the blank gif, but didn't work. $conexao = new conexao(); $query = new Query($conexao); $sql = "SELECT Imagem_data,Imagem_type FROM imagens WHERE CelebID='$celebID'"; $query->executa($sql); $resultado = $query->dados(); $imagem_banco = $resultado['Imagem_data']; $type = $resultado['Imagem_type']; if($imagem_banco != "") { HEADER("Content-type: $type"); echo($imagem_banco); } Thank's Rodrigo --

« previous php.general (#82209) next »