Я пытаюсь INSERT
данных в мою SQL
базу данных, но она ничего не показывает вообще.
Это для ролевой онлайн-игры.Нет ошибки, но когда я обновляю свой браузер для phpmyadmin
, используя XAMP
, данные не отображаются.
MySqlConnection connection = new MySqlConnection(connectionString);
connection.Open();
string checkDatabase = "select * from players where username = @playerName";
MySqlCommand command = new MySqlCommand(checkDatabase, connection);
command.Parameters.AddWithValue("@playerName", player.SocialClubName);
MySqlDataReader reader = command.ExecuteReader();
if(reader.Read())
{
player.SendChatMessage("There is an account with the assiociated Social Club Profile!");
}
else
{
MySqlConnection connection1 = new MySqlConnection(connectionString);
connection1.Open();
string playerInsert = "insert into players(username,password) VALUES (@user,@password)";
MySqlCommand command1 = new MySqlCommand(playerInsert, connection1);
command1.Parameters.AddWithValue("@user", player.SocialClubName);
command1.Parameters.AddWithValue("@password", password);
connection1.Close();
}
connection.Close();