title: MySQL UPDATE WHERE IN for each listed value separately?
body: <p>I've got the following type of SQL:</p>
  
  <pre><code>UPDATE photo AS f 
    LEFT JOIN car AS c 
           ON f.car_id=c.car_id 
    SET f.photo_status=1
      , c.photo_count=c.photo_count+1 
    WHERE f.photo_id IN ($ids)
  </code></pre>
  
  <p>Basically, two tables (<code>car</code> &amp; <code>photo</code>) are related. The list in $ids contains unique photo ids, such as (34, 87, 98, 12). With the query, I'm setting the status of each photo in that list to "1" in the <code>photo</code> table and simultaneously incrementing the photo count in the <code>car</code> table for the car at hand.</p>
  
  <p>It works but there's one snag: Because the list can contain multiple photo ids that relate to the same car, the photo count only ever gets incremented once. If the list had 10 photos associated with the same car, photo_count would become 1 .... whereas I'd like to increment it to 10.</p>
  
  <p>Is there a way to make the incrementation occur for each photo individually through the join, as opposed to MySQL overthinking it for me?</p>
  
  <p>I hope the above makes sense. Thanks.</p>