Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php prepared statement upload file

$query = "INSERT INTO contracts(`filename`,`filedata`, `filetype`,`filesize`) VALUES (?,?,?,?)";
$stmt = $con->prepare($query);
$null = NULL;
$stmt->bind_param("sbsi", $filename, $filedata, $filetype,$filesize);
$stmt->send_long_data(1, file_get_contents($_FILES['upload']['tmp_name'])); 
$stmt->execute();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #prepared #statement #upload #file
ADD COMMENT
Topic
Name
3+6 =