Ver Mensaje Individual
  #8 (permalink)  
Antiguo 14/07/2012, 20:28
ruben_chirinos_1985
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: Como sumar notas definitivas conultando en tabla

Observa hice estas consultas y no me funciona me muestra puros ceros

Código PHP:
Ver original
  1. $sqll= mysql_query("select * from periodo_escolar order by id desc") or die(mysql_error());
  2. $array3 = mysql_fetch_array($sqll);
  3.    
  4.    
  5. $sql=mysql_query("select count(nota1) as total from notas where lapso = '".$array3['lapso']."' and cod_alu = '".$array['cod_alu']."'") or die("Problemas en el select:".mysql_error());
  6. $reg=mysql_fetch_array($sql);
  7.        
  8.        
  9. $sql8=mysql_query("select Avg(definitiva) AS definitiva FROM notas WHERE cod_alu = '".$array['cod_alu']."' and lapso = '".$array3['lapso']."'") or die("Problemas en el select:".mysql_error());
  10. $reg8=mysql_fetch_array($sql8);
  11.  
  12. $total_notas=$reg8['definitiva']/$reg['total'];
  13.  
  14. echo $reg8['definitiva'];

Si quieres entra en el sistema y veras
unt.sytes.net/liceo2/index.php

entra en la pate de modulo estudiantes con el usuario y clave este 10210210 y ve a historial de notas alli veras en el segundo cuadro al final los ceros