public users(string username, string password) { username = GetMD5Hash(username); password = GetMD5Hash(password); connect con = new connect("main"); string query = "SELECT passhash, post FROM users WHERE userhash='" + username + "'"; MySqlDataReader dr = con.reader(query); if (dr.Read()) { message = "read"; if (password == dr[0].ToString()) { message = "sucess"; post = dr[1].ToString(); con.closeConnection(); } else { message = "no-match"; } } else { message = "error"; } con.closeConnection(); }