【问题标题】:Search for string in Oracle database with oci_bind_by_name使用 oci_bind_by_name 在 Oracle 数据库中搜索字符串
【发布时间】:2015-12-29 14:01:10
【问题描述】:
$statement = oci_parse($connection, "select * from customer where username = ':username'");

oci_bind_by_name($statement, ':username', $username);

我想将用户输入与数据库进行比较。我认为语句中的引号有问题。

【问题讨论】:

    标签: php sql oracle oracle-call-interface


    【解决方案1】:

    改成这个,你不应该把绑定变量放在单引号里:

    $statement = oci_parse($connection, "select * from customer where username = :username");
    

    有关更多示例,请参阅oci_bind_by_name 文档:

    http://php.net/manual/en/function.oci-bind-by-name.php

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-22
      • 1970-01-01
      • 2013-05-29
      • 2010-10-13
      • 2013-07-13
      • 2012-10-06
      相关资源
      最近更新 更多