I have a table with 2 columns in phpmyadmin, I can connect and read one column but the other does not, it gives the following error
An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll
Additional information: Unknown column 'in' where clause '
MySqlConnection conectar = new MySqlConnection(conex);
MySqlCommand command = conectar.CreateCommand();
command.CommandText = "SELECT id from hackers where Nick= "+textBox1.Text;
try{
conectar.Open();
MessageBox.Show("Conexão estabelecida!!");
}
catch (Exception ex)
{ MessageBox.Show(ex.Message); }
MySqlDataReader reader = command.ExecuteReader();
while(reader.Read())
{ label1.Text = reader["nick"].ToString(); }
conectar.Close();
}
When I use SELECT NICK FROM HACKERS WHERE id = x works but the opposite does not