stringsql="select id,username,email,last_ip,last_login from account where username=@username";
MySqlCommandcmd=newMySqlCommand(sql,conn);
cmd.Parameters.AddWithValue("username",username);
MySqlDataReaderrdr=cmd.ExecuteReader();
while(rdr.Read())
{
try
{
this.Id=rdr.GetUInt32(0);
this.Username=rdr.GetString(1);
this.Email=rdr.GetString(2);
this.LastIP=rdr.GetString(3);
this.LastLogin=rdr.GetDateTime(4);
}
catch(Exceptione)
{
Console.WriteLine(e);
}
}
rdr.Close();
sql="select username,name,level,race,class from characters.characters join auth.account on characters.characters.account = auth.account.id where characters.characters.account=@id";