Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <?php
  2. $q= $_REQUEST["q"];
  3. $r = $_REQUEST["r"];
  4. $s = $_SESSION['empid'];
  5. $max = 0;
  6. $dbhost = 'localhost:3306';
  7. $dbuser = 'root';
  8. $dbpass = '';
  9. $dbname = 'employeesurvey';
  10. $conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);
  11. $sql1 = "SELECT QuestionID FROM question";
  12. if(!mysqli_query($conn,$sql1)){
  13. echo 'error2 php';
  14. }
  15. while($rw1 = mysqli_fetch_array($sql1)){
  16. $Q = $rw1['QuestionID'] ;
  17. if ($max<$Q){
  18. $max = $Q;
  19. }
  20. }
  21. $Q = $Q+1;
  22. $sql = "INSERT INTO question VALUES (".$Q.",'".$r."',".$s.",CURRENT_DATE(),".$q.",0)";
  23. if(!mysqli_query($conn,$sql)){
  24. echo "Error";
  25. }
  26.  
  27. xmlhttp = new XMLHttpRequest();
  28. xmlhttp.open("GET", "gethint1.php?q=" + cid + "&r=" + question, true);
  29.  
  30. if(!mysqli_query($conn,$sql1)){
  31.  
  32. $resultSet = mysqli_query($conn,$sql1);
  33. if(!$resultSet){
  34.  
  35. while($rw1 = mysqli_fetch_array($sql1)){
  36.  
  37. while($rw1 = mysqli_fetch_array($resultSet)){
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement