Example - Modify an image from a mySQL BLOB
<?
mysql_connect("localhost", "user", "password");
mysql_select_db("mydatabase");
$query = "SELECT photo FROM image_table";
$result = mysql_query($query);
$data = mysql_result($result, 0, "photo");
$im = imagecreatefromstring($data);
$red = imagecolorallocate($im, 255, 0, 0);
imagestring($im, 5, 20, 20, "FIRED!", $red);
header("Content-type: image/png");
imagepng($im);
?>
|