ver la imagen obtenida en la tabla

I use table to fetch cars information from my database and each column in this table contain car information's but in the last column i want to view in it car picture which is save in my database, i already have my code to fetch picture from my database and can view it in the browsers directly. but how i can view the picture directly in the table column without open the picture in new windows. view code

while($rows=mysql_fetch_array($result)){
?>
<tr>
<td class="style1"><?php echo $rows['branch']; ?></td>
<td class="style1"><?php echo $rows['model']; ?></td>
<td class="style1"><?php echo $rows['doors']; ?></td>
<td class="style1"><?php echo $rows['fuel']; ?></td>
<td class="style1"><?php echo $rows['engine']; ?></td>
<td class="style1"><?php echo $rows['colo']; ?></td>
<td class="style1"><?php echo $rows['wheel']; ?></td>
<td class="style1"><?php echo $rows['condit']; ?></td>
<td class="style1"><?php echo $rows['warranty']; ?></td>
<td class="style1" style="width: 47px"><?php echo $rows['price']; ?></td>
<td class="style1"><?php echo $rows['CarOwner']; ?></td>
<td align="center" class="style3"><a href="info.php?id=<?php echo $rows['CarOwner']; ?>"><?php echo $rows['CarOwner']; ?></a></td>
<td align="center" class="style3"><?php echo "download.php"; ?></td>

and this download image from MySQL

<?php
//$id    = $_GET['id'];
include_once 'D_B.php';// Connect to server and select database.
$query = "SELECT `name`, `type`, `size`, `content`  FROM `upload` WHERE `id`='1'";
$result = mysql_query($query) or die('Error, query failed');
list($name, $type, $size, $content) =mysql_fetch_array($result);

header("Content-length: $size");
header("Content-type: $type");
echo $content;
exit;
?>

preguntado el 08 de noviembre de 11 a las 11:11

don't you know an HTML tag for the image? -

1 Respuestas

Just use the address of your link as src atributo de <img> etiqueta, así:

<td><img src="image.php?id=<?php echo $rows['imageId']; ?>"/></td>

respondido 08 nov., 11:15

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.