[13:03:29] CheckAccount IS OK !
[13:03:29] OnAccountCheck IS OK !
[13:03:29] Get rows is OK! rows : - fields :
[13:03:29] pSQLid : - pPass :
stock CheckAccount(playerid)
{
new query[82];
printf("CheckAccount IS OK !");
format(query, sizeof(query), "SELECT id, Password FROM `users` WHERE `Username` = '%s'", returnName(playerid));
mysql_function_query(1, query, true, "OnAccountCheck", "d", playerid);
return 1;
}
forward OnAccountCheck(playerid);
public OnAccountCheck(playerid)
{
printf("OnAccountCheck IS OK !");
if(playerid != INVALID_PLAYER_ID)
{
new rows, fields;
cache_get_data(rows, fields);
printf("Get rows is OK! rows : %s - fields : %s",rows,fields);
if(rows)
{
Player[playerid][pSQLid] = cache_get_row_int(0, 0);
cache_get_row(0, 3, Player[playerid][pPass], 1, 130);
printf("pSQLid : %s - pPass : %s",Player[playerid][pSQLid],Player[playerid][pPass]);
ShowLoginScreen(playerid);
}
else
{
ShowRegisterScreen(playerid);
}
}
return 1;
}
[13:03:29] Get rows is OK! rows : - fields :
[13:03:29] pSQLid : - pPass :
[13:02:53] [DEBUG] CMySQLHandle::Create - creating new connection..
[13:02:53] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
[13:02:53] [DEBUG] CMySQLHandle::Create - connection created with ID = 1
[13:02:53] [DEBUG] CMySQLConnection::Connect - connection was successful
[13:02:53] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[13:02:53] [DEBUG] CMySQLConnection::Connect - connection was successful
[13:02:53] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[13:03:29] [DEBUG] mysql_tquery - connection: 1, query: "SELECT id, Password FROM `users` WHERE `Username` = 'Miami'", callback: "OnAccountCheck", format: "d"
[13:03:29] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[13:03:29] [DEBUG] mysql_tquery - scheduling query "SELECT id, Password FROM `users` WHERE `Username` = 'Miami'"..
[13:03:29] [DEBUG] CMySQLQuery::Execute[OnAccountCheck(d)] - starting query execution
[13:03:29] [DEBUG] CMySQLQuery::Execute[OnAccountCheck(d)] - query was successful
[13:03:29] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[13:03:29] [DEBUG] CMySQLQuery::Execute[OnAccountCheck(d)] - data being passed to ProcessCallbacks()
[13:03:29] [DEBUG] Calling callback "OnAccountCheck"..
[13:03:29] [DEBUG] cache_get_data - connection: 1
[13:03:29] [DEBUG] cache_get_row_int - row: 0, field_idx: 0, connection: 1
[13:03:29] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "0"
[13:03:29] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[13:03:29] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
cache_get_row(0, 1, Player[playerid][pPass], 1, 130); |
[13:36:17] Get rows is OK! rows : 1 - fields : 2
[13:36:17] pSQLid : 0 - pPass : 07A199D9A7E21A62464B36B87BB8F4A26DE7B61A4BC0FFDCB621E6913FB9F66BF6019461335A0E105FB5F8A217CD
Fixed. Thanks @xJayce @BroZeus
When the row is 1? ( cache_get_row(1 ,....) ) Thanks. |
mysql_function_query(1, "SELECT id FROM `users`", true, "Just_a_Example", "");//see the query it will select id of all users
public Just_a_Example()
{
new rows = cache_get_row_count();//get num of rows in result
for(new i = 0;i < rows; i++)
{
new id = cache_get_row_int(i, 0);//number of row changes here, see the 'i'
printf("User id :%d row: %d", id, i);
}
return 1;
}