Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/04/2010, 09:32
Avatar de Kristhoff
Kristhoff
 
Fecha de Ingreso: abril-2009
Ubicación: Popayán - Cauca
Mensajes: 550
Antigüedad: 15 años
Puntos: 12
Imprimir datos de array organizado

Hola amigos de foros del web.

os comento mi problema, nesecito realizar una consulta a una base de datos que me genere lo siguiente:



pero el resultado que he conseguido es este:



y aqui esta el codigo que uso:

Código PHP:
<? include "config.php"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Prueba de organizacion de datos en matriz</title>
</head>
<?
echo "<h1>".$nom_col."</h1>";
echo 
$lemacol;
?>
Prueba de organizacion de datos en matriz
<br /><br />
<table border="1" align="center" width="40%">
<?
$query
="select alumnos.nombres_alum, alumnos.apellidos_alum, acudiente.nombre_acu, acudiente.apellidos_acu, alum_acu_rel.parent from alumnos, acudiente, alum_acu_rel where ((alumnos.Ident_alum = alum_acu_rel.ident_alum) and (acudiente.Ident_acu = alum_acu_rel.ident_acu) and (alumnos.ident_alum=1234567891))";

$result=mysql_query ($query$link);
//$array=mysql_fetch_array($result);

while ($array=mysql_fetch_array($result)) {
            
$nombres=;
            
$apellidos=$array["apellidos_array"];
            echo 
"<tr>\n";
            echo 
"<td>".$array["nombres_alum"]." "."$apellidos</td>\n";
            while ()
            echo 
"<tr><td>".$array["parent"].": ".$array["nombres_acu"]." ".$array["apellidos_acu"]."</td></tr>\n";
             }

?>
</table>
<body>
</body>
</html>
agradeceria que alguien me ayude.