function getImage($id, $width, $height)
{
$link=mysql_connect("hostname","username","password") or die("can't connect to server");
mysql_select_db("dbname",$link) or die("Can't connect to database");
$sql="Select `Photo` from `Phototable` where `ID`='$id'";
$result=mysql_query($sql);
if($row=mysql_fetch_assoc($result))
{
$bytes = $row["Photo"];
if(strlen($bytes)==0)
{
$instr = fopen("default.jpg","rb");
$bytes = fread($instr,filesize("default.jgp"));
}
}
$data = base64_encode($bytes);
echo '
}
?>