所以我有一個MySQL數據庫,我想寫一個IP地址到特定的和現有的行。如何將數據插入到特定行MySQL C#
例如,用戶名「Johnny」登錄,系統將進入用戶名「Johnny」的行並寫入列ipaddress
。
目前我只知道如何使用,以創建一個完整的新行:
queryStr = "INSERT INTO webappdemo.userregistration(firstname,middlename,lastname,email,phonenumber,username,slowHashSalt)" +
"VALUES(?firstname, ?middlename, ?lastname, ?email, ?phonenumber, ?uname, ?slowHashSalt)";
所以,問題是如何通過用戶名和濾波寫入特定列寫現有行。
謝謝。
看看這個帖子:[插入值與where子句(http://stackoverflow.com/a/9166197/3060520) –
使用where子句更新查詢。 – Shan