Ok so i have this script “connector.js”
if(login) {
GUI.BeginGroup(new Rect(10,10,200,400),"");
GUI.Box(Rect(0,0,190,140),"Account");
GUI.Box(Rect(0,30,190,20),"username");
nom = GUI.TextField (Rect (0, 50, 190, 20), nom, 20);
GUI.Box(Rect(0,70,190,20),"Password");
pass = GUI.TextField (Rect (0, 90, 190, 20), pass, 20);
if(GUI.Button(Rect(0,130,190,20),"Login")) {
connection.Open(); //on ouvre la connexion
//commandsql = MySqlCommand("SELECT level,gold,health,exp,damage FROM users WHERE name = "+nom+" and pass = "+pass+";",connection);
commandsql = MySqlCommand("SELECT level FROM users WHERE name = 'dick' and pass = 'fag';",connection);
lecteurbdd = commandsql.ExecuteReader(); //on envoie la requete
connection.Close();
login = false;
}
}
most importantly this line here
commandsql = MySqlCommand("SELECT level FROM users WHERE name = 'dick' and pass = 'fag';",connection);
when i run this in my phpmyadmin ,i get a value of 58 for the level
how do i make it so i can get the value from “level” in mysql to a var level : int = 0; kinda thing.