Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $q1 = $_POST['q1'];
- $query="";
- $query2="";
- if ($q1 == "c1" ) {
- $query = "UPDATE `question1` SET score = score + 1 WHERE choices = 'choice1'";
- }
- if ($q1 == "c2" ) {
- $query = "UPDATE `question1` SET score = score + 1 WHERE choices = 'choice2'";
- }
- if($query){
- //execute first query here
- }
- $q2 = $_POST['q2'];
- if ($q2 == "c1" ) {
- $query2 = "UPDATE `question2` SET score = score + 1 WHERE choices = 'choice1'";
- }
- if ($q2 == "c2" ) {
- $query2 = "UPDATE `question2` SET score = score + 1 WHERE choices = 'choice2'";
- }
- if($query2){
- //execute second query here
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement