I want to create a function that will receive values as parameters and upload them to a MySQL database. My problem is passing a blob to the function and uploading it to the database. My function currently looks like this:
public function addPost($id,$title,$description,$submitted_by,$screenshot)
{
$conn = $this->connect(); //connect to the database
$sql = "insert into complaint values('null','$title','$description',now(),'0000-00-0000:00:00.000000','$id','$status','$image','$screenshot')";
$result = mysqli_query($conn,$sql);
if($result)
{
return true;
}
else
{
return false;
}
}`