Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. $q1 = $_POST['q1'];
  2. $query="";
  3. $query2="";
  4. if ($q1 == "c1" ) {
  5.  
  6. $query = "UPDATE `question1` SET score = score + 1 WHERE choices = 'choice1'";
  7. }
  8. if ($q1 == "c2" ) {
  9.  
  10. $query = "UPDATE `question1` SET score = score + 1 WHERE choices = 'choice2'";
  11. }
  12. if($query){
  13. //execute first query here
  14. }
  15.  
  16. $q2 = $_POST['q2'];
  17.  
  18. if ($q2 == "c1" ) {
  19.  
  20. $query2 = "UPDATE `question2` SET score = score + 1 WHERE choices = 'choice1'";
  21. }
  22. if ($q2 == "c2" ) {
  23.  
  24. $query2 = "UPDATE `question2` SET score = score + 1 WHERE choices = 'choice2'";
  25. }
  26. if($query2){
  27. //execute second query here
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement