Ver Mensaje Individual
  #6 (permalink)  
Antiguo 16/04/2010, 11:59
Curda
 
Fecha de Ingreso: septiembre-2009
Ubicación: Queretaro
Mensajes: 51
Antigüedad: 14 años, 7 meses
Puntos: 2
De acuerdo Respuesta: Mostrar imagen blob en tabla

Cita:
Iniciado por Jowel17 Ver Mensaje
mira ahora mi problema es k en ves de la imagen me muestra esto :

GIF89ah�@�æ��Š†{skToH4�Ž‹©ÈîUOGÿÿô¯¯¨ÐÓË3./Ƕ™{‡‘‰‘^MD;Š«×G7,ŽmSâèÛÄħôóå|„O”¸â‰}iÍž_¢™†ýý zîòæòôèÃhŒ€ZEf41ž¦¬lz‡~|{zT@{tiYiz·¶�lu<ÇƲaWGÕãöƒ œ¯öÒŽ¾¿£je_§¢Š¹ª’°rwëìßJT`õûïT+/( aZVqkf«¢•ÁÙõcA.èâÏÒ˸ûñØÞÜˬ‰\ž©s  ”™˜ÛÀ�óìÓ’šnòüþûç¶òðâŸ}YÕÔ½µŸ…÷õç‰aKÕêis|üúèV[0½N‰>EM¦¯VŸ·Ôe`KöæÎÜß×fkq^7!B ‡ŒEåÔ¯ûôã:7:aL=âîø™X^GJuN:`_bã»y*´€" •�VœBqzgnÌζrvZ89(ÿûÆô÷ì\"(�Àèfk+~FN%"'2®¯�wb M{8?§_c¹¹¹ÿÿÿ!ù�����,����h�@��ÿ€~‚ƒ„…†‡ˆ‰Š‹Œ�Ž� ‘’“”•–—˜™š›™‚œŸ ¡¢£‘žH‘u*®®Q![kD*u¹º!jq%+qq+ÃÆÇÆRÌÏÍÑJc;¨


lo recorte para no poner todo pero k tengo k hacer para arreglar esto?
Código PHP:
Ver original
  1. <html>
  2. <body bgcolor="#FFFFFF" style="background-image: url('')">
  3. <link href="style.css" type="text/css" rel="stylesheet" />
  4. <head>
  5. <?php
  6. function conectarse($host,$usuario,$password,$BBDD){
  7.    $link=mysql_connect($host,$usuario,$password) or die (mysql_error());
  8.    mysql_select_db($BBDD,$link) or die (mysql_error());
  9.    return $link;
  10. }
  11.  
  12. $link=conectarse("localhost","user","pass","DB");
  13.  
  14. $id = $_GET['id'];
  15. $sql = "SELECT * FROM detalles WHERE id = '$id';";
  16. $sql = mysql_query($sql, $link);
  17.  
  18. ?>
  19. <html>
  20. <head>
  21. <title>ASELIN - Asesoria Legal Inmobiliaria</title>
  22. <meta name="author" content="Joel Encinas / [email protected]" />
  23. </head>
  24.  
  25. <center>
  26. <table width="50%" border=0 cellspacing=2 cellpadding=4 style="position:absolute;top:0px;left:0px; bordercolor=; width:720px; height:29px"666633" bgcolor="white">
  27. <tr bgcolor="a0e528"><td><b><font color="437c0b">Descripción</font></b></td><td><b><font color="437c0b">Imagen</font></b></td>
  28. <?
  29. while ($rs=mysql_fetch_array($sql))
  30.   {
  31. $imagen = "<img src='http://tuurl.com/tupath/images.php?id=".$rs['ID']."'>";
  32. echo "<tr>"
  33.            ."<td>".$rs['descripcion']."</td>"
  34.            ."<td>".$imagen."</td>"
  35.            ."</tr>";
  36.            }
  37. ?>
  38. </table></center>
  39.  
  40. </body>
  41. </html>


Y este es el codigo del image.php
Código PHP:
/* Script image.php */

function conectarse($host,$usuario,$password,$BBDD){
   
$link=mysql_connect($host,$usuario,$password) or die (mysql_error());
   
mysql_select_db($BBDD,$link) or die (mysql_error());
   return 
$link;
}

$link=conectarse("localhost","user","pass","DB"); 

$id $_REQUEST['id']; 
 
$sql "SELECT * FROM detalles WHERE id = '$id';";
 
$res mysql_query($qry);
 
$tipo mysql_result($res0"filetype");
 
$contenido mysql_result($res0"imagen");

 
header("Content-type: $tipo");
 print 
$contenido
DE verdad según yo ya te habían dicho cual era la solución pero bueno aquí te la pongo prácticamente, aquí esta la solución ok?