Tema: Oracle + Php
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/11/2008, 00:37
Avatar de kikolice
kikolice
 
Fecha de Ingreso: marzo-2004
Mensajes: 1.510
Antigüedad: 20 años, 2 meses
Puntos: 7
Respuesta: Oracle + Php

alguna vez conecte php con oracle, tenia este codigo de ejemplo

Código PHP:
<?php

$db_conn 
ocilogon"usuario oracle""password oracle" );

$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>Table</b></td>\n<td><b>Type</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";

?>
si no mal recuerdo necesitas tener activado la extension oci8 en tu configuracion de php
__________________
Blogzote.com :-) Mi blog