can't add a photo to FIrebird. Writing such a code
$imgSrc='Desert.jpg';
$img_src = $imgSrc;
$imgbinary = fread(fopen($img_src, "r"), filesize($img_src));
$img_str = base64_encode($imgbinary);
$blh = ibase_blob_create($this->db);
ibase_blob_add($blh, $img_str);
$blobid = ibase_blob_close($blh);
$row = false;
/*$fd = fopen('Desert.jpg', 'r');
$blob = ibase_blob_import($fd);
fclose($fd); */
$query = ibase_query($this->db, "INSERT INTO \"ud_ab\" (FILES) VALUES (?)", $img_str ) or die(ibase_errmsg());
if($query) $row = true;
return $row;
Tried to translate the picture in base64 format, wrote ibase_blob_add.Nothing helps
$img_str, I think you should pass$blobid(or maybe$blh) toibase_query. Note that it is not necessary to base64 encode this, as a blob is - by default - binary data. Note that I don't program in PHP, I'm just guessing based on this question: stackoverflow.com/questions/28801781/…