Guest User

Untitled

a guest
Oct 22nd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. // ALL TIME //
  2. $mikep = mysqli_query($link, "SELECT tasks.EID, reports.how_did_gig_go FROM tasks INNER JOIN reports ON tasks.EID=reports.eid WHERE `priority` IS NOT NULL AND `partners_name` IS NOT NULL AND mike IS NOT NULL GROUP BY EID ORDER BY tasks.show_date DESC;");
  3. $num_rows_mikep = mysqli_num_rows($mikep);
  4. $rating_sum_mikep = 0;
  5. while ($row = mysqli_fetch_assoc($mikep)) {
  6. $rating_mikep = $row['how_did_gig_go'];
  7. $rating_sum_mikep += $rating_mikep;
  8. }
  9. $average_mikep = $rating_sum_mikep/$num_rows_mikep;
  10.  
  11. // AND NOW WITH A LIMIT 10 //
  12.  
  13. $mikep_limit = mysqli_query($link, "SELECT tasks.EID, reports.how_did_gig_go FROM tasks INNER JOIN reports ON tasks.EID=reports.eid WHERE `priority` IS NOT NULL AND `partners_name` IS NOT NULL AND mike IS NOT NULL GROUP BY EID ORDER BY tasks.show_date DESC LIMIT 10;");
  14. $num_rows_mikep_limit = mysqli_num_rows($mikep_limit);
  15. $rating_sum_mikep_limit = 0;
  16. while ($row = mysqli_fetch_assoc($mikep_limit)) {
  17. $rating_mikep_limit = $row['how_did_gig_go'];
  18. $rating_sum_mikep_limit += $rating_mikep_limit;
  19. }
  20. $average_mikep_limit = $rating_sum_mikep_limit/$num_rows_mikep_limit;
Add Comment
Please, Sign In to add comment