所以我有一个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