Krátká odpověď
Jednoduše echo
z adresy URL obrázku v src
atribut a zobrazí se obrázek.
<img id="result_img" src="<?php echo $imagelink; ?>" />
Osvědčené řešení:
Návrh tabulky:
images
| id | title | link | imagelink | description |
------------------------------------------------------------------------
| 1 | Some Title | http://www.google.com | myimage1.png | Some text |
------------------------------------------------------------------------
| 2 | My Title | http://www.yahoo.com | myimage2.png | Some text |
SQL dotaz
SELECT title, link, imagelink, description FROM images WHERE id = ?
PHP
<?php
$stmt = $mysqli->prepare("SELECT title, link, imagelink, description FROM images WHERE ID = ?");
$stmt->bind_param("i", $ID);
$stmt->execute();
$stmt->bind_result($title,$link,$imagelink,$description);
$stmt->fetch();
?>
<div class="pagination" style="display:inline">
<ul style="background-color:#">
<li><div class="span3_search">
<h2><a href='<?php echo $link; ?>'><b><?php echo $title; ?></b></a></h2>
<br />
<img id="result_img" src="<?php echo $link; ?>" />
<br />
<?php echo $description; ?>
<br />
<a href='<?php echo $link; ?>'><?php echo $link; ?><br /><br /></a>
<p></div>
</li>
</ul>
</div>