【问题标题】:How to insert a blob using Zend如何使用 Zend 插入 blob
【发布时间】:2012-02-22 10:28:00
【问题描述】:

如何使用 zend db 将 blob 插入到 oracle 数据库中的 blob 列中,我尝试查看 Zend 文档但找不到。

【问题讨论】:

    标签: php oracle zend-framework blob


    【解决方案1】:

    这样,

      $blobimage = file_get_contents("path/to/some/image");
      $data = array('blobcolumn' => $blobimage);
      $this->insert(bin2hex($data));
    

    $this 指向Zend_Db_Table

    【讨论】:

    • 谢谢,我试过了,但我得到 ORA-01465: invalid hex number ,这是为什么呢?
    • 刚刚使用 bin2hex 将我的二进制文件转换为十六进制数:$this->insert(bin2hex($data));它奏效了
    猜你喜欢
    • 1970-01-01
    • 2018-11-13
    • 1970-01-01
    • 2017-10-01
    • 2017-07-24
    • 1970-01-01
    • 2021-08-31
    • 2013-06-02
    • 1970-01-01
    相关资源
    最近更新 更多