I need to update a field in a mySQL db where the row is identified with two key criteria. Here is what works using a single criterion:
cmd.CommandText = $"UPDATE `" + tableName + "` SET `" + fieldName + "` = '" + value + "' WHERE (`" + identifier + "` = '" + id + "');";
I tried to add a second criterion with an additional WHERE, but it won’t compile.
cmd.CommandText = $"UPDATE `" + tableName + "` SET `" + fieldName + "` = '" + value + "' WHERE (`" + identifier + "` = '" + id + "') + "' WHERE (`" + otherIdentifier + "` = '" + otherKey + "');";
How do I identify a specific row with two key criteria?
1