26.07.2016, 18:50
Here's my AC function -- it's to format a number, example: AC(5000) returns 5,000;
And here's my GetNameFromMySQLID
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;
}
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;
}

