HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
SQLdriver: Update same column on multiple rows with different values
Bleistivt
Moderator
Maybe I have overlooked something, but is it possible to build a query that updates the same column over multiple rows with different values using the query builder?
e.g. if I wanted to update the discussion count of users 2,7,8 who have the discussion counts 50, 600, 70
[ 2 => 50, 7 => 600, 8 => 70 ]
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
0
Comments
I wouldn't have known how to do that in pure SQL! That's why I've googled and I've found that:
http://stackoverflow.com/questions/20255138/sql-update-multiple-records-in-one-query
http://sqlfiddle.com/#!2/e820f/1
You would have to build up that WHERE clause "manually" but then it should be okay for the Update function.