Kort antwoord
Gewoon echo
uit de URL van de afbeelding in de src
attribuut en de afbeelding wordt weergegeven.
<img id="result_img" src="<?php echo $imagelink; ?>" />
Gewerkte oplossing:
Tafelontwerp:
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-query
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>