24.01.2010, 19:20
well you can use mysql_num_row like if your query is SELECT * FROM `players` WHERE Name = '%s' AND Password = '%s' LIMIT 1",pName,pass);
ADDED: Or method 2, with strcmp.
Now
if(strcmp(inputtext, PlayerPassword, true) == 0) { Login ok} else{ Failed }.
ADDED: Or method 2, with strcmp.
pawn Код:
new sql[512], row[128];
format(sql, sizeof(sql), "SELECT Password FROM players where Name = %s", PlayerName);
mysql_query(sql);
mysql_store_result();
mysql_fetch_row(row);
new PlayerPassword[128];
strmid(PlayerPassword, row, 0, strlen(row), 255);
mysql_free_result();
if(strcmp(inputtext, PlayerPassword, true) == 0) { Login ok} else{ Failed }.