I'm trying to put a compressed image into a mysql database with the following code:
$im = ImageCreateFromJPEG($src);
$src1 = ImageJPEG($im, 'firstphoto.jpg', '75');
$data = addslashes(fread(fopen($src1, "rb"), filesize($src1)));
Well, $src is the file variable retrieved from a form with a file input field. I get this message:
Warning: fopen("1","rb") - No such file or directory in c:\phpdev\www\scripts\image4.php on line 8
Warning: Supplied argument is not a valid File-Handle resource in c:\phpdev\www\scripts\image4.php on line 8
Now I can see that I'm getting a handle returned rather than data but i have looked all over th forums and can find no information on this.
All I want to do is take an image from a form, compress and resize it and put it in a db table.....but I can't.
Any ideas floating about out there?
Cheers.