My current coding pulls a stored image from a MYSQL DB and displays it:
$link = mysql_connect("localhost", "model_admin", "model"); mysql_select_db ("model_applications");
$id = $GET[id];
$img = $GET[img];
$result = mysql_query("SELECT file FROM photos WHERE id=$id", $link);
$i = "0";
while($i<$img){
$row = mysql_fetch_array($result);
{
$data = $row['file'];
$type = $row['type'];
}
$i++;
}
if ($type=="pjpeg") $type = "jpeg";
Header( "Content-type: $type");
echo $data;
I need to know how to take that $data and resize it to a certain width and height before it is output to the browser. Any ideas?