PHP firebird insert blob file into the database apache suddenly stop working

喜你入骨 提交于 2019-12-02 07:29:05

问题


I'm currently working on inserting image on the firebird database and it's working fine alone, see the code below.

$dbh = ibase_connect($host, $user, $pass);

$blh = ibase_blob_create($dbh);   
ibase_blob_add($blh, $data);
$blobid = ibase_blob_close($blh);

$sql = "INSERT INTO blobtable(blobfield) VALUES (?)";  
$sth = ibase_query($dbh, $sql, $blobid);

but when I add some data on the insert statement suddenly the apache crash and stops working. See below code when I add new data.

$dbh = ibase_connect($host, $user, $pass);

$blh = ibase_blob_create($dbh);   
ibase_blob_add($blh, $data);
$blobid = ibase_blob_close($blh);

$sql = "INSERT INTO blobtable(name, desc, blobfield ) VALUES (?, ?, ?)";   
$sth = ibase_query($dbh, $sql, $name, $desc, $blobid);

回答1:


See the blob_create function in this gist:

https://gist.github.com/rowland/d59ee296f8be4b581fed

Probably your $data is larger than the maximum segment size.



来源:https://stackoverflow.com/questions/28801781/php-firebird-insert-blob-file-into-the-database-apache-suddenly-stop-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!