Upload image to mysql - Can someone help me please!

images php coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Post by Oleg Butuzov » Tue Feb 18, 2003 6:39 am

<?
$f=fopen("image.jpg","rb");
$upload=fread($f,filesize("image.jpg"));
fclose($f);
$upload=addslashes($upload);
mysql_query("INSERT INTO `table` (`collum`) VALUES ('$upload')");
?>

you can modify this script for your needs...

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Post by Oleg Butuzov » Tue Feb 18, 2003 10:04 pm

i forgot say, field for image must be BLOB-type =)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests