Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/12/2007, 17:18
Avatar de kikolice
kikolice
 
Fecha de Ingreso: marzo-2004
Mensajes: 1.510
Antigüedad: 20 años, 1 mes
Puntos: 7
Re: conectar formulario php con Oracle?

yo una vez para pruebas logre la conexion con el siguiente ejemplo

Código PHP:
$db_conn ocilogon"usuario""password" );

$cmdstr "select tname, tabtype from tab";

$parsed ociparse($db_conn$cmdstr);
ociexecute($parsed);

$nrows ocifetchstatement($parsed$results);


echo 
"<html><head><title>Oracle PHP Test</title></head><body>";
echo 
"<center><h2>Oracle PHP Test</h2><br>";
echo 
"<table border=1 cellspacing='0' width='50%'>\n\<tr>\n";
echo 
"<td><b>Name</b></td>\n<td><b>Salary</b></td>\n</tr>\n";

for (
$i 0$i $nrows$i++ ) 
{
    echo 
"<tr>\n";
    echo 
"<td>" $results["TNAME"][$i] . "</td>";
    echo 
"<td>" $results["TABTYPE"][$i] . "</td>";
    echo 
"</tr>\n";
}

echo 
"<tr><td colspan='2'> Number of Rows: $nrows</td></tr></table>";
echo 
"<br><em>If you see data, then it works!</em><br></center></body></html>\n"
creo recordar que necesitas la extension php_oci8 o algo asi
__________________
Blogzote.com :-) Mi blog