title: I have an SQL syntax error when inputing data
body: <p>I'm a beginner programmer and I'm getting a problem that I cannot seem to overcome. I predict it's a small syntax error but I don't know.</p>
  
  <p>The code I'm using is the following:</p>
  
  <pre><code>&lt;?php
  $x=$_POST['firstname'];
  $y=$_POST['lastname'];
  $servername = "localhost";
  $username = "root";
  $password = "";
  $dbname="db1";
  //Create connection
  $conn = new mysqli($servername, $username, $password,$dbname);
  
  //Check connection
  if ($conn-&gt;connect_error) {
      die("Connection failed: " . $conn-&gt;connect_error);
  }
  echo "Connected successfully";
  $sql = "INSERT INTO 'user' ('fname', 'lname') VALUES ('$x','$y')";
  
  if ($conn-&gt;query($sql) === TRUE) {
      echo "New record created succesfully";
  } else {
      echo "Error: " . $sql . "&lt;br&gt;" . $conn-&gt;error;
  }
  
  ?&gt;
  </code></pre>
  
  <p>Once I press submit to input the data the following error comes up:</p>
  
  <p>Connected successfullyError: INSERT INTO 'user' ('fname', 'lname') VALUES ('rty','rty')
  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 ''user' ('fname', 'lname') VALUES ('rty','rty')' at line 1</p>
  
  <p>Any help? Thanks in advance.</p>