Guest User

Untitled

a guest
Jan 20th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  2. $email = $_POST["Email"];
  3. $username = $_POST["Voornaam"];
  4. $lastname = $_POST["Achternaam"];
  5. $gender = $_POST["Geslacht"];
  6. $mobile = $_POST["Mobiel"];
  7. $streetname = $_POST["Straatnaam"];
  8. $zip = $_POST["Postcode"];
  9. $city = $_POST["Woonplaats"];
  10.  
  11. if($gender == "Man"){
  12. $gender = 0;
  13. } else {
  14. $gender = 1;
  15. }
  16.  
  17. $stmnt = $conn->prepare("
  18.  
  19. INSERT INTO 'users' ('id', 'email', 'username', 'lastname', 'gender', 'mobile', 'streetname', 'zip', 'city')
  20. VALUES (NULL, '" . $email . "', '" . $username . "', '" . $lastname . "', '" . $gender . "', '" . $mobile . "', '" . $streetname . "', '" . $zip . "', '" . $city . "');
  21.  
  22.  
  23. ");
  24.  
  25.  
  26. $stmnt->execute();
  27.  
  28. header('Location: /scs/dashboard.php');
  29. die();
  30. }
  31.  
  32. Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''users' ('id', 'email', 'firstname', 'lastname', 'gender', 'mobile', 'streetn' at line 1 in C:xampphtdocsscsfunctions.php:39 Stack trace: #0 C:xampphtdocsscsfunctions.php(39): PDOStatement->execute() #1 {main} thrown in C:xampphtdocsscsfunctions.php on line 39
Add Comment
Please, Sign In to add comment