Hi Mattmcg,
I haven't tested this yet, but here goes.
this is not the complete code ,but will give you
ideas.
I'm assume'n you know how to upload files using forms
and how to extract data from forms. If not
go to
and read up.
------ add_image.php--------------
// first use a form data to upload files
// is it jpeg or gif?
$image_attrib = GetImageSize($uploaded_image);
$err_flag = 0;
if (($image_attrib[2] != 1 & $image_attrib[2] !=2){
// not jpeg or gif
$err_flag = 1;
}
if ($err_flag != 1){
// insert image
// open file
$image_file = addslashes(fread(fopen($uploaded_image,"r"

,10000));
// you'll want to get the image type and store that too.
$SQL = "INSERT INTO $table
(image,image_type) VALUES
('$image_file','$image_type')";
mysql_query($SQL,$dbh);
}
-------------- end addimage script --------------------
-------------- view_image.php ------------------------
// script to view images.
// usages : <img src="view_image.php?pic_id=$pic_id">
$dbh = mysql_connect($host,$user,$password);
mysql_select_db($db_name,$dbh);
$SQL = "SELECT image,image_type FROM $table
WHERE pic_id = '$pic_id'";
$result = mysql_query($SQL,$dbh);
$record = mysql_fetch_array($result);
$image = $record[image];
$image_type = $record[image_type];
// assum'n $image_type is either "image/gif" or
// "image/jpeg"
Header("Content-type: $image_type"

;
echo $image;
flush();
-------------------- end of script ---------------------
You'll probably want to do error check and stuff .. don't
just copy and paste .. this script was meant to get you
start in the right direction.
Cheers