dear friends,
I have created Php form to store data in my mysql database. But i am facing problem in updating file data to store in database. Please check my code below
$edate=$_POST['edate'];
//$edate=date("d-m-y h:i:s a",time());
$ldate=$_POST['ldate'];
//$ldate=date("d-m-y h:i:s a");
$cdetail=$_POST['cdetail'];
$tenNo=$_POST['tenNo'];
$tdetail=$_POST['tdetail'];
$name = ($_FILES['uploaded_file']['name']);
$mime = ($_FILES['uploaded_file']['type']);
$data = (file_get_contents($_FILES ['uploaded_file']['tmp_name']));
$size = intval($_FILES['uploaded_file']['size']);
$sql1="INSERT INTO tentb(edate,ldate,cdetail,tenNo,tdetail,size,data,name,mime) VALUES('$edate','$ldate','$cdetail','$tenNo','$tdetail','$size','$data','$name','$mime')";
$result1=$conn1->query($sql1);
if($result1){
echo "<script>
alert('Data has saved')
</script>";
header("Refresh:2; url=tenderadd.php");}
else{
$msg='Error'. $conn1->connect_error;
header("refresh:2; url=tenderadd.php");
}
}
uploaded_file is upload file tag name.