php prepared statement upload file

Solutions on MaxInterview for php prepared statement upload file by the best coders in the world

showing results for - "php prepared statement upload file"
Julia
23 Mar 2018
1$query = "INSERT INTO contracts(`filename`,`filedata`, `filetype`,`filesize`) VALUES (?,?,?,?)";
2$stmt = $con->prepare($query);
3$null = NULL;
4$stmt->bind_param("sbsi", $filename, $filedata, $filetype,$filesize);
5$stmt->send_long_data(1, file_get_contents($_FILES['upload']['tmp_name'])); 
6$stmt->execute();