title: Warning: SQLite3::exec(): near ".": syntax error
body: <p>I am creating a login system with PHP and SQLite, in the logic to insert the user in the database, my code is as followed:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
   class my_db extends SQLite3 {
  
      public $first_name;
      public $last_name;
      public $email;
      public $password;
  
      public function __construct($first_name, $last_name, $email, $password) {
          $this-&gt;first_name = $first_name;
          $this-&gt;last_name = $last_name;
          $this-&gt;email = $email;
          $this-&gt;password = $password;
          $this-&gt;open("didactic-eureka.db");
      }
  
      public function create_user_table() {
          $sql = &lt;&lt;&lt;EOF
        CREATE TABLE IF NOT EXISTS USER(
            ID PRIMARY KEY NOT NULL ,
            FIRST_NAME TEXT NOT NULL ,
            LAST_NAME TEXT NOT NULL ,
            EMAIL TEXT NOT NULL ,
            PASSWORD TEXT NOT NULL 
        );
  EOF;
          $this-&gt;exec($sql);
      }
  
      public function insert_user() {
          $sql = &lt;&lt;&lt;EOF
       INSERT INTO USER(FIRST_NAME, LAST_NAME, EMAIL, PASSWORD)
       VALUES ($this-&gt;first_name,$this-&gt;last_name,$this-&gt;email,$this-&gt;password);
  EOF;
  46        $insert = $this-&gt;exec($sql);
  
          if (!$insert) {
              $this-&gt;lastErrorMsg();
          } else {
              echo "User Inserted into the database";
          }
      }
  }
  
  
  if (isset($_POST["submit"])) {
  //    Get value from form
      $first_name = htmlspecialchars($_POST['first_name']);
      $last_name = htmlspecialchars($_POST['last_name']);
      $email = htmlspecialchars($_POST['user_email']);
      $password = htmlspecialchars($_POST['user_password']);
  
  //    Check if values is empty
      if (empty($first_name) || empty($last_name)) {
          $err = "alert alert-danger";
          $err_msg = "Please enter a first or last name";
      } else {
          if (empty($email)) {
              $err = "alert alert-danger";
              $err_msg = "An email is required";
          } else {
              if (empty($password)) {
                  $err = "alert alert-danger";
                  $err_msg = "A password is required";
              } else {
                  //    Hash password when all parameters are passed
                  $hashed_password = password_hash($password, PASSWORD_DEFAULT);
                  $db = new my_db($first_name, $last_name, $email, $hashed_password);
  
                  // Create table
                  $db-&gt;create_user_table();
  
                  // Insert data into table
                  $db-&gt;insert_user();
              }
          }
      }
  }
  
  ?&gt;
  
  </code></pre>
  
  <p>When I try it out in the browser, it get the following response back:</p>
  
  <p><strong>Warning: SQLite3::exec(): near "@gmail": syntax error in /var/www/html/index.php on line 46</strong></p>
  
  <p>How do I fix this?</p>