Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/06/2002, 08:25
andresac
 
Fecha de Ingreso: junio-2002
Mensajes: 7
Antigüedad: 21 años, 10 meses
Puntos: 0
Re: PHP + Oracle (mostrar datos)

yo muestro los datos de esta forma

$sql = "SELECT cod_doc, nombre_doc, rut, fecha_vcto, monto_neto, impuesto ";
$sql .= "FROM contab.fn_tipo_documento ";
$sql .= " ORDER BY cod_doc asc";
putenv("ORACLE_SID=orac");
$conn = ocinlogon($pub_user,$pub_pass,$pub_serv);
$stmt = ociparse($conn,$sql);
OCIDefineByName($stmt,"COD_DOC",$codigo) ;
OCIDefineByName($stmt,"NOMBRE_DOC",$nomb re);
OCIDefineByName($stmt,"RUT",$rut);
OCIDefineByName($stmt,"FECHA_VCTO",$fech a_vcto);
OCIDefineByName($stmt,"MONTO_NETO",$mont o_neto);
OCIDefineByName($stmt,"IMPUESTO",$impues to);
ociexecute($stmt);
echo "<P>";
echo "<center>";
echo "<table width=90% BORDER=1>";
echo "<CAPTION ALIGN=CENTER ><tr><td colspan=6 align=center bgcolor=#22AE22><h3>Tipos de Documentos</h3></CAPTION>";
echo "<tr>";
echo "<th>Codigo</th>";
echo "<th>Nombre</th>";
echo "<th>Rut</th>";
echo "<th>Fecha<br>Vcto.</th>";
echo "<th>Monto<br>Neto</th>";
echo "<th>Impuesto</th>";
echo "</tr>";
while (ocifetch($stmt))
{
echo"<tr><td align=center><a href=tipo_documento.php?accion=1&cod_bus=$codi go>";
echo"$codigo</a></td><td>$nombre</td>";
echo"<td align=center>";
if ($rut == 'S'){echo"<input type=checkbox name='op_rut' checked>";}
else{echo"<input type=checkbox name='op_rut'";}
echo"</td>";
echo"<td align=center>";
if ($fecha_vcto == 'S'){echo"<input type=checkbox name='op_fecha' checked>";}
else{echo"<input type=checkbox name='op_fecha'";}
echo"</td>";
echo"<td align=center>";
if ($monto_neto == 'S'){echo"<input type=checkbox name='op_monto' checked>";}
else{echo"<input type=checkbox name='op_monto'";}
echo"</td>";
echo"<td align=center>";
if ($impuesto == 'S'){echo"<input type=checkbox name='op_impuesto' checked>";}
else{echo"<input type=checkbox name='op_impuesto'";}
echo"</td>";
}
ocifreestatement($stmt);
ocilogoff($stmt);
echo "</table>";
echo "</center>";

espero que te sea util ;)