1

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
  • im trying to insert blob into firebird database, im trying this code, but i cant understand what variable do you send as the blob. blobfield is what in that code? And what is your data? its the tmp_name? Commented Sep 1, 2021 at 9:42

1 Answer 1

3

See the blob_create function in this gist:

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

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

Sign up to request clarification or add additional context in comments.

1 Comment

thanks brent for the answer, I think it might be. the file size of my upload is 1mb and greater.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.