Ver Mensaje Individual
  #6 (permalink)  
Antiguo 13/12/2008, 21:25
waltergs
 
Fecha de Ingreso: diciembre-2008
Mensajes: 3
Antigüedad: 15 años, 4 meses
Puntos: 0
De acuerdo Respuesta: ayuda con mostrar resultados de consulta php en una tabla

Gracias Okram, Ronruby y Gatorv fuero muy amables al qyudarme, me guiaron por el camino que era

aqui esta el codigo funcional con PHP y un poco html

consulta .php
Código PHP:
<html >
<head>
<title>CONSULTA DE ESTADO</title> 
<style type="text/css">
<!--
.Estilo4 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
.Estilo8 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; color: #FF0000; font-weight: bold; }
.Estilo9 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    color: #FF0000;
    font-size: 18px;
    font-weight: bold;
    font-style: italic;
-->
</style>
<head>
<body>
<h3 align="center"><span class="Estilo9">Resultados De Tu Consulta</span></h3>
<h3>
<?php 
$link 
mysql_connect("localhost""usuario""pass"); 
mysql_select_db("usuarios",$link); 
$query "SELECT * FROM usuario WHERE nuid='".mysql_escape_string($_POST['caja1'])."'";
   
$result = @mysql_query($query);
   if (!
$result|| mysql_num_rows($result)==0)  return false

?>
<BR><BR><BR> 
<center> 
<table border=1 bordercolor="#FF0000"  bgcolor="#FFFFCC"> 
<tr> <td> <span  class="Estilo8">Nombre </span></td> <td><span  class="Estilo8"> Direccion </span></td> <td><span  class="Estilo8">  Tarifa </span></td> <td><span  class="Estilo8">  Deuda </span></td> <td><span  class="Estilo8">Intereses</span></td> <td><span  class="Estilo8">  Valor Total Factura </span></td> </tr>


<?php
   
while ($row mysql_fetch_array($result)) {
    echo 
'<tr>';
    echo 
'<td><span  class="Estilo4">'.$row['usuario'].'</span></td>';
    echo 
'<td><span  class="Estilo4">'.$row['direccion'].'</span></td>';
    echo 
'<td><span  class="Estilo4">'.$row['liq_aseo'].'</span></td>';
    echo 
'<td><span  class="Estilo4">'.$row['val_mora'].'</span></td>';
    echo 
'<td><span  class="Estilo4">'.$row['inte_mora'].'</span></td>';
    echo 
'<td><span  class="Estilo4">'.$row['val_tot_fa'].'</span></td>';
    echo 
'</tr>';
    }
    
    
    echo 
mysql_error(); 
?>

</table>
</body>
</html>

Y también el archivo htmal en donde esta el campo y el boton


[
Código HTML:
<html> 
<head> 
<script type="text/javascript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=400');");
}
</script>
<title>CONSULTA DE ESTADO</title> 
<style type="text/css">
<!--
.Estilo10 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
</head> 

<body> 
<form name="formulario1" action="consulta.php" method="POST"> 
<BR><BR><BR> 
<center> 
<table border=1 bordercolor="#FF0000"> 
<tr> 
<td bordercolor="#FF0000" bgcolor="#FFFFCC"><span class="Estilo10">Codigo Usuario</span></td> 
<td bordercolor="#FF0000" bgcolor="#FFFFCC"><input type=text name=caja1 value="Escriba Codigo"></td> 
</tr> 
<tr> 
<td colspan=2 bordercolor="#FF0000" bgcolor="#FFFFCC"><center><input type=submit value=consultar></center></td> 
</tr> 
</table> 

</center> 
</form> 
</body> 
</html> 

Y en esta página el ejemplo funcional

www.espladorada.com/consulta.html

escriban el codigo 106277


Gracias más adelante lo explico es que no soy tan bueno para eso todavía

gracias FOROS DEL WEB

Última edición por waltergs; 13/12/2008 a las 21:32