Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. $sql = " SELECT Question FROM examQuestions";
  2. $result = mysqli_query($dbCon, $sql);
  3.  
  4. if(mysqli_num_rows($result)>0)
  5. {
  6. while($row = mysqli_fetch_assoc($result))
  7. {
  8. echo '<input type="checkbox" name="checkboxvar[]" value="'.$row["Question"].'">'.$row["Question"].'<input placeholder="10" class="form-control" type="number" name="points[]">'."<br />";
  9. }
  10. }
  11.  
  12. $checkboxvar = $_POST['checkboxvar'];
  13. $examName = $_POST['examName'];
  14. $questionWorth = $_POST['points'];
  15.  
  16. $i=1;
  17. $total = 0;
  18.  
  19. while($i <4)
  20. {
  21. $x = $i - 1;
  22.  
  23. echo $checkboxvar[$x];
  24. echo $questionWorth[$x]."<br />";
  25. $total = $total + $questionWorth[$x];
  26. $i = $i +1;
  27.  
  28. }
  29.  
  30. echo $total;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement