-1
我新的PHP和我試圖「PHP代碼上傳數據庫表BLOB數據類型的圖像」 ...... 如上標題PDO越來越不確定的變量
<?php include 'connection.php';
function insertBlob($filePath, $mime)
{
$blob = fopen($filePath, 'rb');
$sql = "INSERT INTO files(mime,data) VALUES(:mime,:data)";
$stmt = $this->pdo->prepare($sql);
$stmt->bindParam(':mime', $mime);
$stmt->bindParam(':data', $blob, PDO::PARAM_LOB);
return $stmt->execute();
}
$strSQL-> insertBlob('C:\Users\Vishal\Desktop\house.png',"image/png");
if(mysqli_query($con, $strSQL)){
echo "Records added successfully.";
} else{
echo "ERROR: Could not able to execute $strSQL. " . mysqli_error($con);
}
?>
提到我得到這個錯誤
什麼是對的'blob.php'從你手上有這個地方 –
19行? '$ strSQL->' –
你的意思是'$ strSQL = insertBlob(...)'? –