使用oracle和php更新

时间:2018-12-28 14:50:28

标签: php oracle oci

我的数据未使用以下代码提交:

<?php
$itens = 3;
$nota_aux = '1212';
$nota_xml = '33412';
$campo_aux = 'aux1';
$campo_xml = 'xml1';

for ($i=3; $i <= $itens; $i++) {
    $conn = oci_connect ('aux', 'aux', 'localhost/aux');

    $query = "update mlf_auxnfitem SET {$campo_aux} = (select {$campo_xml} from mrlv_nfeimportacaoitem where seqnotafiscal = {$nota_xml} and seqnfitem = {$i})
     where seqauxnotafiscal = {$nota_aux} and seqauxnfitem = {$i};";

    $stid = oci_parse($conn, $query);
    $r = oci_execute($stid);

    echo $query;

    oci_free_statement($stid);
    oci_close($conn);
}

上面的代码有什么问题?我使用了本教程:https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/oow10/php_db/php_db.htm?print=preview

oci_error(由aynber建议)展示

  

ORA-00911:无效字符

0 个答案:

没有答案