i'm trying to insert an image using (cakephp) to sqlite DB in a BLOB column.
i'm using this code
$insert = "INSERT INTO story (page, image)
VALUES (:page, :image)";
$stmt = $file_db->prepare($insert);
// Bind parameters to statement variables
$img = file_get_contents($this->request->data['image']['tmp_name']);
$img = mysql_real_escape_string($img);
$stmt->bindParam(':page', $this->request->data['page']);
$stmt->bindParam(':image', $img);
// Execute statement
$stmt->execute();
and it's inserting but a characters set not a blob data as it suppose to be.. is there any other way to do it or else what is the wrong with my code?