title: PHP Insert into MySQL syntax error
body: <p>I'm having trouble submitting some data to MySQL via php, i get the following error:</p>
  
  <p><strong>"Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''student' (UID, FirstName, LastName, DOB, EmergencyContact, Address, City, State' at line 1"</strong></p>
  
  <p>I'm not sure where i've gone wrong, any help would be great.</p>
  
  <pre><code>&lt;?php
  $firstname = $_POST['firstname'];
  $lastname = $_POST['lastname'];
  $dob = $_POST['dob'];
  $emergencycontact = $_POST['emergencycontactperson'];
  $address = $_POST['addressline1'];
  $city = $_POST['city'];
  $state = $_POST['state'];
  $zip = $_POST['zip'];
  $homephone = $_POST['homephone'];
  $cellphone = $_POST['cellphone'];
  $guardian = $_POST['guardian'];
  $inneighborhood = 0;
  if ($zip == "49503")
      $inneighborhood = 1;
  
  $con = mysqli_connect("localhost", "cookarts_root", "password", "cookarts_database");
  
  // Check connection
  if (mysqli_connect_errno()) {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  
  $sql = "INSERT INTO 'student' (FirstName, LastName, DOB, EmergencyContact, Address,       City, State, ZIP, CellPhone, HomePhone, Guardian, InNeighborhood)
  VALUES
  ($firstname', '$lastname', '$dob', '$emergencycontact', '$address', '$city', '$state', '$zip', '$cellphone', '$homephone', '$guardian', '$inneighborhood')";
  
  if ($con-&gt;query($sql) === TRUE) {
        echo 'users entry saved successfully';
  }   
  else {
    echo 'Error: '. $con-&gt;error;
  }
  
  mysqli_close($con);
  ?&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/9yEVe.png" alt="enter image description here"></p>
  
  <p>If you need more info i'd be happy to provide it, thanks again for the help.</p>