Problemas con oci_execute Muy buenas a todos:
Tengo el siguiente código para presentar datos desde Oracle a través de PHP:
//Conectamos a la base de datos
$conn = oci_connect("sysman", "novasys","cubbic");
$stmt = oci_parse($conn, "select url from pdfsmadrid where texto like '%$cadena%';");
if(!$conn)
{
echo("Error en la conexión con la base de datos");
}
//------------------------------------------------------------------------------
//Selección de los datos
oci_execute($stmt);
while (oci_fetch($stmt))
{
echo "\n";
$ncols = oci_num_fields($stmt);
for ($i = 1; $i <= $ncols; $i++) {
$column_name = oci_field_name($stmt, $i);
$column_value = oci_result($stmt, $i);
echo $column_name . ': ' . $column_value . "\n";
}
echo "\n";
}
}
El problema es que me da los siguientes warnings, haga lo que haga, además de no presentar nada:
Warning: oci_execute() [function.oci-execute]: ORA-00911: invalid character in C:\Servidores\Apache\Apache2\htdocs\madrid\search_ m.php on line 137
Warning: oci_fetch() [function.oci-fetch]: ORA-24374: define not done before fetch or execute and fetch in C:\Servidores\Apache\Apache2\htdocs\madrid\search_ m.php on line 139
La variable $stmt vale "Resource id #4".
¿Alguna idea?
Muchas gracias de antemano! |