How to display an image with php? -
i have code, image doesn't show. appears broken link. doing wrong?
i've tried different ways display image, can't display it. image database, , need display row belong slider.
<?php $sql = "select * alianzaclientes tipoclientealianza = 3 "; $res = mysql_query($sql); if (!$res) die('invalid query: ' . mysql_error()); list($id, $nombre, $url, $resena, $imagen, $tipoclientealianza) = mysql_fetch_row($res); $id = $row['id']; $nombre = $row['nombre']; $url = $row['url']; $resena = $row['resena']; $imagen = $row['imagen']; $tipoclientealianza = $row['tipoclientealianza']; ?> <?php echo $imagen ?>
it should this:
<img src="<?=$url?>">
if $imagen variable contains url pass in src in img container. if it's file name make url file name..
Comments
Post a Comment