Exist a tutorial of mysql cache result on the forum?
#1

Hi, i want to learn how to make a simple query, cache the result and then delete it :S

i m searching on gglee, i dont find nothing, here i dont see nothing, it's impossible..


i want to make a query to sqlid to return me the name of player and i dont know, i'm trying to copy other codes but its not same mysql functions and i get errors warnings... i want to learn and i dont know where, but i won' t give up !!!!
Reply
#2

pawn Код:
GetPlant_Owner(sqlid)
{
    new query, id;

    mysql_format(handle, query, sizeof(query), "SELECT `Character` FROM `characters` WHERE `ID` = '%d'", ReturnName(sqlid));
    new Cache:result = mysql_query(handle, query);

    if(cache_num_rows())
    {
        cache_get_value_int(id, "id", id);
    }
    cache_delete(result);

    return id;
}
I don't know how to explain but take the code above as an example.
Reply
#3

Quote:
Originally Posted by Sabur
Посмотреть сообщение
pawn Код:
GetPlant_Owner(sqlid)
{
    new query, id;

    mysql_format(handle, query, sizeof(query), "SELECT `Character` FROM `characters` WHERE `ID` = '%d'", ReturnName(sqlid));
    new Cache:result = mysql_query(handle, query);

    if(cache_num_rows())
    {
        cache_get_value_int(id, "id", id);
    }
    cache_delete(result);

    return id;
}
I don't know how to explain but take the code above as an example.
It throws me errors becouse i use blue G r39 or r41 so its not mysql_format, this is an example:

PHP код:
    new
        
query[512],
        
buffer[129];
    
WP_Hash(buffersizeof(buffer), password);
    
format(querysizeof(query), "INSERT INTO `accounts` (`Username`, `Password`, `RegisterDate`, `LoginDate`) VALUES('%s', '%s', '%s', '%s')"usernamebufferReturnDate(), ReturnDate());
    
mysql_tquery(g_iHandlequery); 
can you write in this? :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)