Advertisement
Sonic3R

Untitled

Jul 3rd, 2011
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. $total=mysql_query("select * from laborator where student='".$email."'");
  2.     $suma=0;$medie=0;$nr_note=0;
  3.     while($student=mysql_fetch_array($total))
  4.     {
  5.         if($student['nota']<=4)
  6.         {$medie=4; }
  7.         else {
  8.             $suma+=$student['nota'];
  9.             $nr_note++;
  10.             $medie=$suma/$nr_note;
  11.            
  12.         }
  13.     }  
  14.     $medie=number_format($medie,2);
  15.        
  16.        
  17. $update_laborator=mysql_query("update laborator set nota=".$nota." where titlu='".$laborator."' and student='".$email."'");
  18.  
  19. $update_laborator1=mysql_query("update laborator set incercari=".$incercari." where titlu='".$laborator."' and student='".$email."'");
  20.  
  21. $update_laborator2=mysql_query("update laborator set promovat=".$promovat." where titlu='".$laborator."' and student='".$email."'");
  22.         $update_users=mysql_query("update users set media=".$medie." where email='".$email."'");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement