$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

Recommended Answers

All 3 Replies

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

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

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.