0
I am making a select with Where via PHP and Oracle, when it receives an error by the parameter occurs:
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 projeto index.php on line
If I pass the direct parameter 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();
}
}
(80) "SELECT * FROM TBLICITCAO WHERE CDLICITACAO = 014384" Warning: oci_execute(): ORA-00911: invalid Character in C: xampp htdocs project includes Read.php on line 48 Warning: oci_fetch_array(): ORA-24374: sets not done before fetch or execute and in C:xampp htdocs project index.php on line 72
– Andre C
Code for lines 48 and 72?
– David Alves
Read.php oci_execute($stid); index.php while ($Row = oci_fetch_array($stid)) {
 $dataAnexos[] = array("IDANEXO" => $row['IDANEXO'],
 "CDLICITACAO" => $row['CDLICITACAO'],
 "NARQUIVO" => $row['NARQUIVO'],
 "DIRARQUIVO" => $row['DIRARQUIVO']);
}
– Andre C
@Andrec Is the name of the table (TBLICITACAO) and the name of the field (CDLICITACAO) higher in the bd? If they are minute, try going to minuscule in php and see if something changes.
– David Alves
They are all uppercase... the funny thing is that only I change the $id = 013203 works... if I leave the parameter not... but the parameter is coming correctly tb. the column in the bank is VARCHAR2(6 BYTE)
– Andre C