<i id='PybjT'><tr id='PybjT'><dt id='PybjT'><q id='PybjT'><span id='PybjT'><b id='PybjT'><form id='PybjT'><ins id='PybjT'></ins><ul id='PybjT'></ul><sub id='PybjT'></sub></form><legend id='PybjT'></legend><bdo id='PybjT'><pre id='PybjT'><center id='PybjT'></center></pre></bdo></b><th id='PybjT'></th></span></q></dt></tr></i><div id='PybjT'><tfoot id='PybjT'></tfoot><dl id='PybjT'><fieldset id='PybjT'></fieldset></dl></div>
  • <small id='PybjT'></small><noframes id='PybjT'>

      • <bdo id='PybjT'></bdo><ul id='PybjT'></ul>
      <tfoot id='PybjT'></tfoot>
    1. <legend id='PybjT'><style id='PybjT'><dir id='PybjT'><q id='PybjT'></q></dir></style></legend>

        使用 PHP 在 Oracle 中将图像上传为 BLOB

        Upload images as BLOBs in Oracle using PHP(使用 PHP 在 Oracle 中将图像上传为 BLOB)
      1. <small id='RioH2'></small><noframes id='RioH2'>

        <i id='RioH2'><tr id='RioH2'><dt id='RioH2'><q id='RioH2'><span id='RioH2'><b id='RioH2'><form id='RioH2'><ins id='RioH2'></ins><ul id='RioH2'></ul><sub id='RioH2'></sub></form><legend id='RioH2'></legend><bdo id='RioH2'><pre id='RioH2'><center id='RioH2'></center></pre></bdo></b><th id='RioH2'></th></span></q></dt></tr></i><div id='RioH2'><tfoot id='RioH2'></tfoot><dl id='RioH2'><fieldset id='RioH2'></fieldset></dl></div>
      2. <legend id='RioH2'><style id='RioH2'><dir id='RioH2'><q id='RioH2'></q></dir></style></legend>

          1. <tfoot id='RioH2'></tfoot>
              <bdo id='RioH2'></bdo><ul id='RioH2'></ul>

                <tbody id='RioH2'></tbody>
                • 本文介绍了使用 PHP 在 Oracle 中将图像上传为 BLOB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  谁能告诉我如何使用 PHP 将图像作为 BLOB 存储在 Oracle 数据库中?

                  Can anyone please tell me how to store images in an oracle database as BLOBs using PHP?

                  一个可行的例子会很好.谢谢.

                  A working example would be nice. Thankyou.

                  推荐答案

                  首先需要从$_FILES #global数组中获取正在上传的图片:

                  You first need to get the image that is being uploaded from the $_FILES #global array:

                  $image = file_get_contents($_FILES['image_field_name']['tmp_name']);
                  

                  然后将图像插入数据库试试这个:

                  Then to insert the image in the database try this:

                  $sql = "INSERT INTO table (id, image) VALUES(1, empty_blob()) RETURNING image INTO :image";
                  
                  $result = oci_parse($connection, $sql);
                  $blob = oci_new_descriptor($connection, OCI_D_LOB);
                  oci_bind_by_name($result, ":image", $blob, -1, OCI_B_BLOB);
                  oci_execute($result, OCI_DEFAULT) or die ("Unable to execute query");
                  
                  if(!$blob->save($image)) {
                      oci_rollback($connection);
                  }
                  else {
                      oci_commit($connection);
                  }
                  
                  oci_free_statement($result);
                  $blob->free();
                  

                  这篇关于使用 PHP 在 Oracle 中将图像上传为 BLOB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)
                • <small id='eaLvk'></small><noframes id='eaLvk'>

                • <i id='eaLvk'><tr id='eaLvk'><dt id='eaLvk'><q id='eaLvk'><span id='eaLvk'><b id='eaLvk'><form id='eaLvk'><ins id='eaLvk'></ins><ul id='eaLvk'></ul><sub id='eaLvk'></sub></form><legend id='eaLvk'></legend><bdo id='eaLvk'><pre id='eaLvk'><center id='eaLvk'></center></pre></bdo></b><th id='eaLvk'></th></span></q></dt></tr></i><div id='eaLvk'><tfoot id='eaLvk'></tfoot><dl id='eaLvk'><fieldset id='eaLvk'></fieldset></dl></div>
                    <bdo id='eaLvk'></bdo><ul id='eaLvk'></ul>
                    <tfoot id='eaLvk'></tfoot>

                    • <legend id='eaLvk'><style id='eaLvk'><dir id='eaLvk'><q id='eaLvk'></q></dir></style></legend>
                          <tbody id='eaLvk'></tbody>