This query works when I type directly into mysql but not in C#.
double deltaTime = (DateTime.Now - collectTime).TotalSeconds;
string query = String.Format("UPDATE buildings LEFT JOIN server_buildings ON buildings.global_id = server_buildings.global_id AND buildings.level = server_buildings.level SET buildings.storage = buildings.storage + (server_buildings.speed * {0} * IF(buildings.boost >= NOW(), 2, 1)) WHERE buildings.global_id IN('generator', 'test')", deltaTime / 3600d);
Only get the error MySQL – Operand should contain 1 column(s)
Appreciate suggestions! 🙂
Expected that over time it would add value in "storage"
2
Answers
Found the solution. Was that my system language is not English. The solution was:
Thanks, appreciate all the help! Im fairly new to mysql.
Here it is with parameters.