how deposit a picture to MYSQL database
below is the code :
<?php
$id=$_POST;
$photo=$_POST;
if ($photo<>""){
$fp=fopen($photo,"r");
$data=addslashes(fread($fp,filesize($photo)));
}
$sql="insert into product(id,pic) values('$id','$data')";
mysql_query($sql,$conn) or die ("插入数据失败: ".mysql_error());
?>
but always unsuccessful! why? plz help me!