我收到此错误:
Unknown column 'admin' in 'where clause'
这是我的登录按钮代码:
mycon.Open();
string cmdstr = "SELECT * FROM usersettingsdb WHERE user_ID = " + textBox1.Text + "";
cmd = new MySqlCommand(cmdstr, mycon);
dr = cmd.ExecuteReader();
string inputpw = "";
string dbpw = "";
while (dr.Read())
{
inputpw = maskedTextBox1.Text;
dbpw = (dr["user_pw"].ToString());
}
dr.Close();
mycon.Close();
我不太明白为什么会出现该错误,因为我的 Select 语句与我在网上看到的所有其他 select 语句相同