27.07.2015, 11:36
Hi, I was fooling around a little bit and I came across a obsticle that I cannot seem to overcome... How can I load mysql r39 data with sscanf?
I tried it like this:
and under the 'load' function
Whats wrong, and could someone explain and preferably show me?
I know that I can use cache_get_field_content(_int, _float) and that its somewhat faster loading, but for the sakes of learning I wanted to do it like that...
I tried it like this:
pawn Код:
mysql_format(database, query, sizeof(query), "SELECT * FROM `server`");
mysql_tquery(database, query, "load", "");
pawn Код:
if(cache_get_row_count())
{
new string [135];
sscanf(string, "p<|>e<s[20]s[5]ifis[20]s[60]>", sData[servername], sData[serverversion], sData[maxping], sData[maxpacketloss], sData[maxteams], sData[website], sData[serverpassword]);
format(string, sizeof(string), "hostname %s %s %s", sData[servername], sData[serverversion], sData[website]);
SendRconCommand(string);
.
.
.
}
I know that I can use cache_get_field_content(_int, _float) and that its somewhat faster loading, but for the sakes of learning I wanted to do it like that...