im trying to store an image in my firebird database(i know its not the best practice but i have to do it) but im getting a Message: ibase_query(): Dynamic SQL Error SQL error code = -104 Unexpected end of command - line 1, column 30
i guess this happens because the blob is too big. i did a print_r
and i get the the entire blob between ''
but i guess its too big for it to handle. I change the blob filed in the database to 4000+ bytes but still it fails. Any tips on how to turn this around?
My code:
$encoded_data = file_get_contents($files['perf_photo']['tmp_name']);
$query = "UPDATE emprs set foto = '{$encoded_data}' WHERE cod_uto = '$cod_uto'";
return ibase_query($transaction, $query);