0
  $stmt=OCIParse($conn,'SELECT *FROM USERS where USER_NAME = "USER_1");

when I want to execute this stmt , I have problem with "32" , error:
OCIStmtExecute: ORA-00904: "32": invalid identifier

maybe somebody know how to replace "" to validate character
apache 4
oracle 11

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by cereal
0

I'm not sure this will help but here is missing the ending single quote:

$stmt=OCIParse($conn,'SELECT * FROM USERS where USER_NAME = "USER_1"');
0

no no ,
I have stmt :

$stmt=OCIParse($conn,'SELECT * FROM USERS where USER_NAME = "USER_1"');

This is not the problem I had as above
I need to change " for something but I do not know what character

0

Unfortunatelly I cannot test, but try this:

$stmt=OCIParse($conn,'SELECT * FROM USERS where USER_NAME = :username');
ocibindbyname($stmt,':username','USER_1');
oci_execute($stmt);

Or try to use single quotes to wrap values:

$stmt=OCIParse($conn,"SELECT * FROM USERS where USER_NAME = 'USER_1'");

you can also add ocierror() which will output more details about the errors. Besides this I cannot help much more, hope someone else will give you a better answer, bye!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.