我尝试在 PHP 页面上执行 Oracle 插入语句,但收到以下错误。如果我从语句中删除分号,则页面永远不会加载(即使后端的插入应该只需要几分之一秒)。任何提示将不胜感激!
$sql_update = "
update schema.table set last_check_dt = (select sysdate from dual)
where id = (select id from schema.email where current_email = '" . $email . "');";
$stid = oci_parse($conn, $sql_update);
oci_execute($stid);
oci_commit($conn);
oci_close($conn);
Warning: oci_execute() [function.oci-execute]: ORA-00911: invalid character
最佳答案
$sql_update = "
update schema.table set last_check_dt = (select sysdate from dual)
where id = (select id from schema.email where current_email = '" . $email . "')";
您的 SQL,当通过 OCI
运行时......不需要 分号
作为终止符。
关于PHP/OCI 插入期间出现无效字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27137993/