title: Wrong values being updated in MySQL
body: <p>$salt2I am working on a login system and am having a problem with updating my salt tables.  I am NOT an expert in sql BUT I know my way around.</p>
  
  <p>My query to update is:</p>
  
  <pre><code>UPDATE hashTable SET `salt1` = 'salt1here' AND `salt2` = 'salt2here' WHERE `userID` = userID
  </code></pre>
  
  <p><code>userID</code> is an integer value so I don't need to quote that.</p>
  
  <p>When I update that table <code>salt1</code> is set to the value of <code>0</code>.  I am using php to create my sql query and that looks like:</p>
  
  <pre><code>UPDATE hashTable SET `salt1` = '$salt1' AND `$salt2` = 'salt2here' WHERE `userID` = $userID
  </code></pre>
  
  <blockquote>
    <p>SIDE NOTE:  I know about sql injection and I do have protection
    against that in my code.  In this case I do not need this because the
    salt values are being generated by the script and user id is a value
    returned by a function.  Any place where I do have user input I strip
    slashes and have ways to prevent injection.</p>
  </blockquote>
  
  <p>To me my sql query seems correct and I know that my values are correct because this is what a dynamically created query looks like:</p>
  
  <pre><code>UPDATE hashTable SET `salt1` = '9d6db1743e5e0cf1bb0e8cd799c0640231a10ec21e1612a6ed46e8ea16862835' AND `salt2` = '0824b2aac446ccfbd719645f84b13443cbcf59ee4e6dabace8c421ff6a8c6688' WHERE `userID` = 1374770432
  </code></pre>
  
  <p>I have even entered that in directly to phpMyAdmin and it says <code>0 rows affected</code>  but still changes my <code>salt1</code> row to <code>0</code>.</p>
  
  <p>I am somewhat baffled because it seems like I'm doing everything correctly but obviously I am not.</p>