MySQL Inline
Šta je MySQL Inline?To je jedna od mogućnosti koja dolazi uz y_inline koja Vam omogućava da u istoj funkciji bez kreiranja novih callbackova kreirate MySQL Cache.
Iz čega se MySQL Inline sastoji?Sastoji se iz 2 funkcije:[pawn]MySQL_PQueryInline(MySQL:handle, Func:cb<>, const query[], GLOBAL_TAG_TYPES:...)
MySQL_TQueryInline(MySQL:handle, Func:cb<>, const query[], GLOBAL_TAG_TYPES:...)[/pawn]
Kako se MySQL Inline funkcije koriste?[pawn]
// -> Database query
inline loadAccount()
{
// Clear Chat Box
ClearChat(playerid, 16);
// Should we redirect user to registration?
if(!cache_num_rows())
return RegisterProcessHandler(playerid);
cache_get_value_name_int(0, "account_id", PlayerDBID[playerid]);
cache_get_value_name(0, "account_password", PlayerPassword[playerid]);
cache_get_value_name(0, "account_mail", PlayerMail[playerid]);
}
MySQL_TQueryInline(dbHandler, using inline loadAccount, "SELECT * FROM `player_account` WHERE `account_username` = '%e' LIMIT 1", PlayerUsername[playerid]);
[/pawn]