title: PHP- Error updating table
body: <p>I am trying to update a row in a MySQL table row like this:</p>
  
  <pre><code>$conn = new mysqli('localhost','root','','db');
  // Check connection
  if ($conn-&gt;connect_error) {
    die("Connection failed: " . $conn-&gt;connect_error);
  }
  
  //if input == members
  $sql = "UPDATE `members` SET id = ".$_POST['id']." fname = ".$_POST['fname'].", lname = ".
  $_POST['lname'].", gender = ".$_POST['gender'].", age_group = ".$_POST['age_group'].", status = ".
  $_POST['status'].", dob_day = ".$_POST['dob_day'].", dob_month = ".$_POST['dob_month'].", wed_anni_day = ".
  $_POST['wed_anni_day'].", wed_anni_month = ".$_POST['wed_anni_month'].", type = ".
  $_POST['type'].", email = ".$_POST['email'].", address  = ".$_POST['address'].", city = ".$_POST['city'].", zipco = ".
  $_POST['zipco'].", contact1 = ".$_POST['contact1'].", contact2 = ".$_POST['contact2'];
  
  if ($conn-&gt;query($sql) === TRUE) {
    echo "Record updated successfully";
  } else {
    echo "Error updating record: " . $conn-&gt;error;
  }
  </code></pre>
  
  <p>I am getting this error:</p>
  
  <pre><code>Error updating record: 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 'fname = s_name, lname = l_name, gender = Female, age_group = Adult, status = ' at line 1
  </code></pre>
  
  <p>What am I doing wrong? 
  Thanks.</p>