MYSQLI准备用于将图像插入DB的语句

时间:2014-03-18 15:09:05

标签: php mysql mysqli

我尝试使用MySQLi预处理语句将图像插入到数据库中。我会对bind_param使用什么;它是s,还是#34;文件"?

$image = file_get_contents($_FILES['image']['tmp_name']);
$imgInsert =$db->prepare("INSERT INTO cars (image) VALUES (?) WHERE model = ? ") 
  or die($db->error);
$imgInsert->bind_param('ss', $image, $model); $imgInsert->execute();

MySQL表格中的内容:

  

图片blob NOT NULL

0 个答案:

没有答案
相关问题