📜  php准备好的语句上传文件 - PHP代码示例

📅  最后修改于: 2022-03-11 14:53:58.040000             🧑  作者: Mango

代码示例1
$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();