Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/05/2011, 18:57
epcode
 
Fecha de Ingreso: septiembre-2010
Mensajes: 39
Antigüedad: 13 años, 7 meses
Puntos: 0
Pregunta Respuesta: Mostrar imágenes guardadas en MySQL con PHP

Mirá:

El archivo blob.php
Código PHP:
<?php
header
("Content-type: image/gif");
if(isset(
$_GET['id'])){
    
$id $_GET['id'];
    
    
$link mysql_connect("localhost""root""") or die ("ERROR AL CONECTAR");
    
$db_select mysql_select_db("db_colossus");
    
    
$q "SELECT i_img FROM items WHERE item_id = '$id'";
    
$img mysql_query($q$link);
    
    print 
$img;
    }
?>
El archivo que muestra una imagen:

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php 
require_once 'blob.php';
?>
<img src="blob.php?id=1" alt="Img" />
</body>
</html>
Sigue sin mostrar nada... ¿Que puede ser?