Ver Mensaje Individual
  #5 (permalink)  
Antiguo 09/07/2012, 15:34
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años, 8 meses
Puntos: 2135
Respuesta: Presentar registros en text area con php 4 usando oracle

Viendo la documentación puedes usar también OCIFetchInto:
Código PHP:
Ver original
  1. $conn = OCILogon('user', 'secret', 'DB');
  2.  
  3.  $th = 0; // Table Header
  4.  
  5.        $query = 'select * from PAYMENT';
  6.  
  7.        $stid = OCIParse($conn, $query);
  8.        OCIExecute($stid);
  9.  
  10.         echo "<table>\n\n";
  11.         while (OCIFetchInto($stid, $row, OCI_ASSOC)) {
  12.           if (!$th) {
  13.  
  14.             $keys = (array_keys($row));
  15.  
  16.             echo "\n<tr>\n";
  17.             foreach ($keys as $k) {echo "<th>" . $k . "</th>\n";}
  18.             echo "</tr>\n";
  19.  
  20.             $th = 1; // Table header done !
  21.                     }
  22.  
  23.           echo "\n<tr>\n";
  24.           foreach ($keys as $k) {echo "<td>" . $row[$k] . "</td>\n";}
  25.           echo "</tr>\n";
  26.           $count = $count + 1;
  27.         }
  28.  
  29.         echo "</table>\n\n";
  30.  
  31. echo "<h3>" . $count . " records</h3>";
  32.  
  33. OCILogoff($conn);