php include_once config php if isset _GET id result mysql_query SELECT

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<?php
include_once 'config.php';
if(isset($_GET['id'])){
$result = mysql_query("SELECT * FROM `images` WHERE `id` = '".$_GET['id']."' ");
while ($img=mysql_fetch_assoc($result)) {
echo '<img src="'.$dir.$img['name'].'">';
}
}
?>