hii,
I have 3 images for a single id like 00024 in the DB. when ever the user selects the ID from the drop down .all the 3 images must be displayed . how do i do this?
this is the image script i use and display images like
<img src='/diabetes/visitimages/thumbpicdisplay .php?id=<?php echo $id ?></img>
I have 3 images for a single id like 00024 in the DB. when ever the user selects the ID from the drop down .all the 3 images must be displayed . how do i do this?
this is the image script i use and display images like
<img src='/diabetes/visitimages/thumbpicdisplay .php?id=<?php echo $id ?></img>
Code:
<?php
include_once('../db.php');
$sql = "SELECT image FROM rop_images WHERE Patient_id='".$_GET['id']."'";
$result = mysql_query("$sql") or die("Invalid query: " . mysql_error());
header("Content-type: image/jpeg");
$test=mysql_result($result,0);
$desired_width = 80;
$desired_height = 80;
$im = imagecreatefromstring($test);
$new = imagecreatetruecolor($desired_width, $desired_height);
$x = imagesx($im);
$y = imagesy($im);
imagecopyresampled($new, $im, 0, 0, 0, 0, $desired_width, $desired_height, $x, $y);
imagedestroy($im);
header("cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header('Content-type: image/jpeg');
imagejpeg($new, NULL, 85);
imagedestroy($new);
// echo $test;
mysql_close($link);
?>
Comment