title: PHP updating table comma error
body: <p>I am updating a table in phpmyadmin like this. My question is basically: Why do I need a comma after <code>'$username'</code>, i.e this <code>$query.="username = '$username' , ";</code>Not sure why this comma is necessary.</p>
  
  <pre><code>function UpdateTable()
  {
      global $connection;
      $username = $_POST['username'];
      $password = $_POST['password'];
      $id = $_POST['id'];
      $query = "UPDATE users SET "; // username is the name of the column in the database, you need the space in  between
      $query.="username = '$username' , ";
      $query.= "password = '$password' ";
      $query.= "WHERE id = $id ";
      $result = mysqli_query($connection,$query);
      if(!$result)
      {
          die("Query failed". mysqli_error($connection));
      }
  }
  </code></pre>