I'm doing a select with where via PHP and Oracle, when you get an error with the parameter:
Warning: oci_execute (): ORA-00911: invalid character in C: \ xampp \ htdocs \ project \ includes \ Read.php on line 52 Warning: oci_fetch_array (): ORA-24374: define not done before fetch or execute and fetch in C: \ xampp \ htdocs \ project \ index.php on line
If I pass the direct parameter it works normally, as commented line, it works.
public function readAnexos($CDLICITACAO) {
try{
//$id = '012103';
$id = $CDLICITACAO;
$sql_query = "SELECT * FROM TBLICITCAO WHERE CDLICITACAO = $id";
$stid = oci_parse($this->db, $sql_query);
oci_execute($stid);
return $stid;
}
catch (Exception $e){
echo $e->getMessage() . "<br>Error na linha: ";
echo "<b>" . $e->getTraceAsString()."</b>";
parent::fechar();
}
}