04/04/2011, 09:22
|
| | Fecha de Ingreso: julio-2010
Mensajes: 64
Antigüedad: 14 años, 5 meses Puntos: 1 | |
Respuesta: construir una tabla dinámica en php con oracle Este es mi codigo para oracle:
<?php
include('adodb/adodb.inc.php');
include('adodb/adodb-error.inc.php');
$db =" (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST =sigestopbl4-vip.corp.cubacel.com)(PORT = 1521))
(CONNECT_DATA= (SID = STAT1))
)
";
$odbc = ocilogon ('ad', 'Ad, $db) or die( "Could not connect to Oracle database!");
if ($odbc == false){
$msg = OCIError($odbc)."<BR>";}
$query = oci_parse($odbc, "select ID, CODE, NODE_DESC from STATDBA.EXCHANGE_ID");
oci_execute($query);
$inc=0;
$row = oci_fetch_row($query);
$filas = oci_num_rows($query);
$columnas = oci_num_fields($query);
echo "<table border='1'>";
echo "<TR>";
echo "<td width='72' bgcolor='#663300' class='style5'><div align='center' class='style7'>No</div></td> ";
echo "<td width='72' bgcolor='#663300' class='style5'><div align='center' class='style7'>Identificador</div></td> ";
echo "<td width='72' bgcolor='#663300' class='style5'><div align='center' class='style7'>Codigo</div></td>";
echo "<td width='72' bgcolor='#663300' class='style5'><div align='center' class='style7'>Descripcion</div></td>";
//echo "<td width='72' bgcolor='#663300' class='style5'><div align='center' class='style7'>Responsable</div></td>";
echo "</TR>\n";
for ($i=0; $i<$filas; $i++)
{
echo "<TR>";
echo "<TD ALIGN='CENTER' BGCOLOR='white' class='style12'>";
$num = $i+1;
echo " $num ";
echo "</TD>";
for ($j=1; $j<$columnas; $j++)
{
echo "<TD ALIGN='CENTER' BGCOLOR='white' class='style12'>";
$valor = oci_result($query, $j);
//$value = oci_result($query,$i);
echo " $valor ";
echo "</TD>";
}
echo "</TR>\n";
}
echo "</TABLE>";
echo "<BR>";
//oci_free_result($query);
?> |