Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: Sonic3R on Jul 3rd, 2011  |  syntax: PHP  |  size: 0.81 KB  |  views: 174  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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."'");