No you make 1 query in plugin init and retrieve 15 rows at once:
PHP Code:
public load_toplist()
{
new szTemp[512]
format(szTemp,charsmax(szTemp),"SELECT * FROM `deathrun` ORDER BY `deathrun`.`points` DESC LIMIT 15")
SQL_ThreadQuery(g_SqlTuple,"Toplist2",szTemp)
return PLUGIN_CONTINUE
}
public Toplist2(FailState,Handle:Query,Error[],Errcode,Data[],DataSize)
{
if(FailState)
{
log_amx("SQL Error: %s (%d)", Error, Errcode)
return PLUGIN_HANDLED
}
new count[32], count1[32], count2, count3, count4, count5
while(SQL_MoreResults(Query))
{
SQL_ReadResult(Query,0, count, 31)
SQL_ReadResult(Query,1, count1, 31)
count2 = SQL_ReadResult(Query,2)
count3 = SQL_ReadResult(Query,3)
count4 = SQL_ReadResult(Query,4)
count5 = SQL_ReadResult(Query,5)
print_color(0, 1, 0, "^x04-=[Pingstars]=- ^x01 %s - %s - %i - %i - %i - %i ", count, count1, count2, count3, count4, count5)
SQL_NextRow(Query)
}
return PLUGIN_HANDLED
}
You can test this with clcmd.
__________________