gogogod
gogogod

Reputation: 135

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);

I've already tested it with "select * from person" and it worked. I want to get a list of persons which first names start with "A". Is this possible?

Upvotes: 1

Views: 2439

Answers (1)

Clay
Clay

Reputation: 4760

Try updating your query to this:

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

Upvotes: 1

Related Questions