Ver Mensaje Individual
  #17 (permalink)  
Antiguo 29/08/2005, 08:37
chiririo
 
Fecha de Ingreso: agosto-2005
Mensajes: 101
Antigüedad: 18 años, 8 meses
Puntos: 0
Filas repetidas

No se si los campos que quieres sacar son de las 3 tablas o solo de una. El codigo que te pongo es para cuando los campos son de las 3 tablas. Para cada fila que te saca la primera consulta (que te deuelve el id) haces otra consulta que te devuelve todos los datos relacionados con ese id. No se si le faltara alguna cosilla pero mas o menos es esto.

Por cierto, soy una chica, como he visto que me has dicho amigo

Código PHP:
<?php
  
while ($row mysql_fetch_array($result)){

      
$query mysql_query("SELECT * from finca,pal,elisa WHERE    
      finca.id=$row["
id"] && finca.id=elisa.finca && finca.id=pal.finca");            
      
$arr mysql_fetch_array($query);
?>
  <tr>
    <td width="6%" height="24" align="center"><?  echo $arr[finca]; ?></td>
    <td width="10%" height="24" align="center"><? echo $arr[planta]; ?></td>
    <td width="6%" height="24" align="center"><?  echo $arr[prov]; ?></td>
    <td width="13%" height="24" align="center"><? echo $arr[propietario]; ?></td>
    <td width="12%" height="24" align="center"><? echo $arr[nombre]; ?></td>
    <td width="5%" height="24" align="center"><?  echo $arr[municipio]; ?></td>
    <td width="5%" height="24" align="center"><?  echo $arr[parroquia]; ?></td>
    <td width="5%" height="24" align="center"><?  echo $arr[litros]; ?></td>
    <td width="5%" height="24" align="center"><?  echo $arr[vacas]; ?></td>
    <td width="6%" height="24" align="center"><?  echo $arr[resultado_pal]; ?></td>
    <td width="5%" height="24" align="center"><?  echo $arr['do']; ?></td>
    <td width="6%" height="24" align="center"><?  echo $arr[resultado_e]; ?></td>
    <td width="7%" height="24" align="center"><?  echo $arr[fecha?></td>
    </tr>
<?php
}
?>