title: Need help with multiple WHERE clause
body: <p>I have an UPDATE query I'd like to perform.</p>
  
  <p>But there need to be 2 conditions met before we can update a quantity in the database.</p>
  
  <p>First, the sessions_id() must match one of the sessionid's in the sessionid column, and second, the Description of the product must match the description of the product corresponding to the sessionid.</p>
  
  <p>Here's what I have:</p>
  
  <pre><code>mysql_query(UPDATE cart 
                 SET quantity = $q, 
               WHERE sessionid = "'.session_id().'" 
                 AND description = $d') or die(mysql_error());
  </code></pre>
  
  <p>Now, it is giving me the following error:</p>
  
  <blockquote>
    <p>You have an error in your SQL syntax;<br>
     check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE sessionid="bqlbh5rdogbhmq70skhtkbvmb0" AND description=$d' at line 1</p>
  </blockquote>
  
  <p>However, I have copied this update query straight from W3Schools, so it must be correct, right? Any help at all would be appreciated.</p>