MySQL loading
#4

Here's my AC function -- it's to format a number, example: AC(5000) returns 5,000;

PHP код:
stock AC(number, const separator[] = ",")
{
    new 
output[15];
    
format(output, sizeof(output), "%d", number);
    for(new 
i = strlen(output) - 3; i > 0 && output[i-1] != '-'; i -= 3)
    {
        
strins(output, separator, i);
    }
    return 
output;
} 
And here's my GetNameFromMySQLID
PHP код:
stock GetNameFromMySQLID(sqlid)
{
    new 
query[128], name[24], lelo[24], count;
    
mysql_format(mysql, query, sizeof(query), "SELECT * FROM `accounts` WHERE ID = %d LIMIT 1", sqlid);
    new 
Cache:result = mysql_query(mysql, query);
    
count = cache_get_row_count();
    
cache_get_row_count();
    
cache_get_row(0, 1, lelo);
    
cache_delete(result);
    
name = lelo;
    if(
count < 1)
    {
        
name = "0";
        return 
name;
    }
    return 
name;
} 
Reply


Messages In This Thread
MySQL loading - by Ahmed21 - 26.07.2016, 18:24
Re: MySQL loading - by Konstantinos - 26.07.2016, 18:36
Re: MySQL loading - by Ahmed21 - 26.07.2016, 18:44
Re: MySQL loading - by Ahmed21 - 26.07.2016, 18:50
Re: MySQL loading - by Konstantinos - 26.07.2016, 19:24
Re: MySQL loading - by PrO.GameR - 26.07.2016, 22:13
Re: MySQL loading - by Ahmed21 - 27.07.2016, 07:17
Re: MySQL loading - by Ahmed21 - 27.07.2016, 09:35
Re: MySQL loading - by Konstantinos - 27.07.2016, 09:40
Re: MySQL loading - by Ahmed21 - 27.07.2016, 09:54

Forum Jump:


Users browsing this thread: 1 Guest(s)