Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/07/2009, 12:14
Avatar de yoyoyo82
yoyoyo82
 
Fecha de Ingreso: julio-2009
Ubicación: Springfield
Mensajes: 159
Antigüedad: 14 años, 9 meses
Puntos: 1
Imprime 2 veces el mismo registro en la consulta

hola amigos tengo otro problema hice una consulta en donde se unen 4 tablas me muestra los registro de la union de las 4 tablas pero el problema es que me imprime 2 veces el mismo registro este es el codigo:
<?
//Conexion con la base
mysql_connect("localhost","root","yoyoyo");

//Ejecutamos la sentencia SQL
$result=mysql_db_query("prep","select `t_alumnos`.`matricula`,`t_calificaciones`.`matric ula`,`t_turno`.`matricula`,`t_turno`.`cve_grupo`,` t_grupo`.`cve_grupo`,nombre,grupo,turno,semestre,a paterno,amaterno,mat_1,cal_1,cal_2,prom_1,mat_2,ca l_3,cal_4,prom_2,mat_3,cal_5,cal_6,prom_3,mat_4,ca l_7,cal_8,prom_4,mat_5,cal_9,cal_10,prom_5,mat_6,c al_11,cal_12,prom_6,mat_7,cal_13,cal_14,prom_7,mat _8,cal_15,cal_16,prom_8,mat_9,cal_17,cal_18,prom_9 ,mat_10,cal_19,cal_20,prom_10,prom_gral from t_calificaciones join t_alumnos on t_calificaciones.matricula=t_alumnos.matricula join t_turno on t_alumnos.matricula=t_turno.matricula join t_grupo on t_turno.cve_grupo=t_grupo.cve_grupo where grupo='1º1-V'");

?>
<table border="1" align="center">
<tr>
<th>Matrícula</th>
<th>Grupo</th>
<th>Turno</th>
<th>Semestre</th>
<th>Nombre</th>
<th>A. Paterno</th>
<th>A. Materno</th>
<th>Materia 1</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_1</th>
<th>Materia 2</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_2</th>
<th>Materia 3</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_3</th>
<th>Materia 4</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_4</th>
<th>Materia 5</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_5</th>
<th>Materia 6</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_6</th>
<th>Materia 7</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_7</th>
<th>Materia 8</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_8</th>
<th>Materia 9</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_9</th>
<th>Materia 10</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_10</th>
<th>Prom. Gral</th>
</tr>


<?
//Mostramos los registros
while ($row=mysql_fetch_array($result))
{
echo '<tr><td>'.$row["matricula"].'</td>';
echo '<td>'.$row["grupo"].'</td>';
echo '<td>'.$row["turno"].'</td>';
echo '<td>'.$row["semestre"].'</td>';
echo '<td>'.$row["nombre"].'</td>';
echo '<td>'.$row["apaterno"].'</td>';
echo '<td>'.$row["amaterno"].'</td>';
echo '<td>'.$row["mat_1"].'</td>';
echo '<td>'.$row["cal_1"].'</td>';
echo '<td>'.$row["cal_2"].'</td>';
echo '<td>'.$row["prom_1"].'</td>';
echo '<td>'.$row["mat_2"].'</td>';
echo '<td>'.$row["cal_3"].'</td>';
echo '<td>'.$row["cal_4"].'</td>';
echo '<td>'.$row["prom_2"].'</td>';
echo '<td>'.$row["mat_3"].'</td>';
echo '<td>'.$row["cal_5"].'</td>';
echo '<td>'.$row["cal_6"].'</td>';
echo '<td>'.$row["prom_3"].'</td>';
echo '<td>'.$row["mat_4"].'</td>';
echo '<td>'.$row["cal_7"].'</td>';
echo '<td>'.$row["cal_8"].'</td>';
echo '<td>'.$row["prom_4"].'</td>';
echo '<td>'.$row["mat_5"].'</td>';
echo '<td>'.$row["cal_9"].'</td>';
echo '<td>'.$row["cal_10"].'</td>';
echo '<td>'.$row["prom_5"].'</td>';
echo '<td>'.$row["mat_6"].'</td>';
echo '<td>'.$row["cal_11"].'</td>';
echo '<td>'.$row["cal_12"].'</td>';
echo '<td>'.$row["prom_6"].'</td>';
echo '<td>'.$row["mat_7"].'</td>';
echo '<td>'.$row["cal_13"].'</td>';
echo '<td>'.$row["cal_14"].'</td>';
echo '<td>'.$row["prom_7"].'</td>';
echo '<td>'.$row["mat_8"].'</td>';
echo '<td>'.$row["cal_15"].'</td>';
echo '<td>'.$row["cal_16"].'</td>';
echo '<td>'.$row["prom_8"].'</td>';
echo '<td>'.$row["mat_9"].'</td>';
echo '<td>'.$row["cal_17"].'</td>';
echo '<td>'.$row["cal_18"].'</td>';
echo '<td>'.$row["prom_9"].'</td>';
echo '<td>'.$row["mat_10"].'</td>';
echo '<td>'.$row["cal_19"].'</td>';
echo '<td>'.$row["cal_20"].'</td>';
echo '<td>'.$row["prom_10"].'</td>';
echo '<td>'.$row["prom_gral"].'</td></tr>';
}
mysql_free_result($result)
?>
gracias