Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/06/2012, 16:14
djviruzz
 
Fecha de Ingreso: junio-2012
Mensajes: 16
Antigüedad: 11 años, 10 meses
Puntos: 0
problema con sql consultar 3 tablas

Buenas amigos me refirieron para mysql , con mi consulta

tengo este codigo para consultar 3 tablas

Cita:
<?php
include('conexion.php');
$cedula=$_GET['cedula'];

$query="SELECT
i.telefono,
i.cedula,
p.nombre,
p.distrito,
c.direccion,
c.salario
FROM
ice AS i
JOIN padron AS p ON i.cedula = p.cedula
JOIN ccss AS c ON p.cedula = c.cedula
WHERE
c.cedula='$cedula' order by nombre asc";
$result= mysql_query($query);

echo "<table id='td' border='1'
bordercolor='#000000'
name='resultado'
cellpadding='0'
cellspacing='0'>
<tr>
<th>TELEFONO</th>
<th>CEDULA</th>
<th>NOMBRE</th>
<th>DISTRITO</th>
<th>DIRECCION</th>
<th>SALARIO</th>
</tr>";
while($fila= mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>".$fila['telefono']."</td>";
echo "<td>".$fila['cedula']."</td>";
echo "<td>".$fila['nombre']."</td>";
echo "<td>".$fila['distrito']."</td>";
echo "<td>".$fila['direccion']."</td>";
echo "<td>".$fila['salario']."</td>";
echo "</tr>";
}
echo "</table>";
?>
el cual es llamado por este form

Cita:
<table align="center" border="2" bordercolor="#000000" cellpadding="0" cellspacing="0">
<tr>
<td><fieldset><br/>
<form id='form' name='form1' action='buscar.php' method='GET' onsubmit='return checkform2(this);'>
"Ingrese-cedula:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input align='middle' type='text' name='cedula' placeholder='Numero id pegado'>
<input type='submit' value='Buscar'></form></fieldset><br/></td>
</tr>

</table>
EL problema esq no me da los datos quiero la informacion de una persona introduciendo su numero de cedula , pero no me da los resultados , me tira la tabla vacia

en el foro de PHP ya me intentaron ayudar , pero aun no lo logro hacer funcionar