go to bug id or search bugs for
BLOB inserts are broken. A syntax error will get thrown because of improper encoding of the binary stream.
COVER_IMAGE = VARBINARY(max)
EXCERPT = VARCHAR(max)
ID = INT
$blob_path = TESTS_BASE_DIR . '/etc/lob/propel.gif';
$clob_path = TESTS_BASE_DIR . '/etc/lob/tin_drum.txt';
$sql = "INSERT INTO media (COVER_IMAGE,EXCERPT,BOOK_ID) VALUES (:p1,:p2,:p3)";
$stmt = $this->con->prepare($sql);
$fileStream = fopen($blob_path, 'r');
$stmt->bindParam(':p1', $fileStream, PDO::PARAM_LOB);
$stmt->bindValue(':p2', file_get_contents($clob_path), PDO::PARAM_STR);
$stmt->bindValue(':p3', 5, PDO::PARAM_INT);
PDOException: SQLSTATE[HY000]: General error: 10007 Incorrect syntax near 'GIF89a?'.  (severity 5) [(null)]
Add a Patch
Add a Pull Request
Due to this extension not seeing any activity since 2005, this issue will not be fixed. We are therefore closing this now.
It's no longer apart a PECL extension...
My sense is that this lines up with the known issue with quoting binary values (67495). Regular string quoting should work fine. If something's wrong there, please post a more specific bug with the data involved so I can try to reproduce.