ORA-01036: 非法变量 name/number - oci_bind_by_name

ORA-01036: illegal variable name/number - oci_bind_by_name

$letter= "A";
$statement = oci_parse($connection, "select * from person where firstname like ':letter%'");
oci_bind_by_name($statement, ':letter', $letter);

我已经使用 "select * from person" 对其进行了测试并且它有效。 我想获得名字以 "A" 开头的人员列表。这可能吗?

尝试将您的查询更新为:

oci_parse($connection, "select * from person where firstname like :letter || '%'");