Hello. I've encountered a small problem with inserting blob data inside sqlite database. Code like this unfortunately don't works correctly:
$this->sqlite->execute($sql, array(
file_get_contents(BASE_DIR.$cover)
);
I prepared a simple solution with internal handler:
$handler = $this->sqlite->getInternalHandler();
$file = file_get_contents(BASE_DIR.$cover);
$query = $handler->prepare($sql);
$query->bindParam(1, $file, \PDO::PARAM_LOB);
$query->execute();
Is there any better solution to insert correct blob data? The main problem here is lack in Phalcon of type like BIND_PARAM_BLOB:
$this->sqlite->execute($sql, array(
file_get_contents(BASE_DIR.$cover)
), array(
\Phalcon\Db\Column::BIND_PARAM_BLOB
));