php + PostgreSQL image storing in db

wxdqz

New Member
Hi all!

I cannot store images in a pgsql database table. I send it with file uploading then reading it with
$binimg = fread($fhandler,filesize($file));
then using
addslashes($binimg);
and after this i try to put it into the right place with
pg_exec("update news set image = '$binimg' WHERE id = '$newsid'");

The data type of news.image is "text".

I trying to test it with a 1x1 pixel size transparent GIF, it is 43 bytes long,starting with "GIF89a" and lots of trash. It puts into the cells until "GIF98a" and the trash is left out.

an ideas? - how to set up a correct query ot tellgin postgres to put the whole image into the function.

thanx!
Gergely "PhOeMiX" Czuczuy
 
Back
Top