I am passing a PHP varibale into a oracle sql query. but its not taking it properly giving me ORA errors like - invalid character. I tried escaping the varibale as \'$sid\', this makes error go, but the query doesnt return anything. Is there a way to pass PHP variable to oracle query
if(isset($_POST['action']))
{
$sid = $_POST['action'];
$stid = oci_parse($conn, 'SELECT emp from table emp='$sid'');
oci_execute($stid);
}
I have removed to the database connection part for brevity.
"SELECT emp from table emp='$sid'""SELECT emp from table emp='$sid';"phpvariable to Oracle placeholder. See Examples section here: php.net/manual/en/function.oci-bind-by-name.php