Using oci_parse and oci_execute

I am sure that this is something very basic, but I can not find my mistake.

I am trying to do the following ...

$c = db_connect();

$email = addslashes($email);

$sql = "SELECT * FROM RUSER WHERE email LIKE '" . $email . "';";
$query = oci_parse($c, $sql) or die(oci_error($c));
$response = oci_execute($query) or die(oci_error($c));

but I get oci8 statement Warning: oci_execute(): ORA-00911: invalid character in /path/to/file.php on line 67where line 67 is where $response.

So something is wrong with $queryright? But I can’t find what it would be. Raw sql runs fine from the command line. echoing get_resource_type($query)gives a resource identifier ...

What am I doing wrong?

+5
source share
2 answers

; SQL. ; SQL, SQL- (, sql * plus) , , .

+12

$c = oci_connect("user","password","host/dbname") // db_connect() is not true

";"

$sql = "SELECT * FROM RUSER WHERE email LIKE '" . $email . "';";

$sql = "SELECT * FROM RUSER WHERE email LIKE '" . $email . "'"; 

"=", LIKE

+1

All Articles