Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $sql = " SELECT Question FROM examQuestions";
- $result = mysqli_query($dbCon, $sql);
- if(mysqli_num_rows($result)>0)
- {
- while($row = mysqli_fetch_assoc($result))
- {
- echo '<input type="checkbox" name="checkboxvar[]" value="'.$row["Question"].'">'.$row["Question"].'<input placeholder="10" class="form-control" type="number" name="points[]">'."<br />";
- }
- }
- $checkboxvar = $_POST['checkboxvar'];
- $examName = $_POST['examName'];
- $questionWorth = $_POST['points'];
- $i=1;
- $total = 0;
- while($i <4)
- {
- $x = $i - 1;
- echo $checkboxvar[$x];
- echo $questionWorth[$x]."<br />";
- $total = $total + $questionWorth[$x];
- $i = $i +1;
- }
- echo $total;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement