Welcome Guest, Not a member yet? Register   Sign In
PDO and CI 3.0
#1

[eluser]Unknown[/eluser]
I am trying to insert a blob with CI 3.0 and PDO. Everything else seems to work fine but I cannot insert blobs. I also tried the prepare/execute method of PDO handling but that doesn't work either. I tried this code:

$sql = "INSERT INTO images (imgname,imgtype,imgwidth,imgheight,imgdata,imgthumb,status) VALUES (?,?,?,?,?,?,?)";
$stmt = $this->db->prepare($sql);
$stmt->bindParam(1, $name, PDO:TongueARAM_STR);
$stmt->bindParam(2, $type, PDO:TongueARAM_STR);
$stmt->bindParam(3, $width, PDO:TongueARAM_INT);
$stmt->bindParam(4, $height, PDO:TongueARAM_INT);
$stmt->bindParam(5, file_get_contents($url), PDO:TongueARAM_LOB);
$stmt->bindParam(6, file_get_contents($thumburl), PDO:TongueARAM_LOB);
$stmt->bindParam(7, '0', PDO:TongueARAM_INT);
$stmt->execute();

and I get this error: Call to undefined method CI_DB_pdo_mysql_driver::prepare()

Any ideas?

(yes, I have set up for pdo as my driver in the database.php config file and other 'regular' queries are working fine.)


Messages In This Thread
PDO and CI 3.0 - by El Forum - 06-17-2014, 10:31 PM
PDO and CI 3.0 - by El Forum - 06-19-2014, 06:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB