pawn Код:
#include "a_samp"
#include "mysql"
new connectionhandle,
numrows,
numfields
;
main()
{
connectionhandle = mysql_connect("", "", "", "");
mysql_function_query(connectionhandle, "SELECT * FROM `usuarios` ORDER BY Matou DESC LIMIT 10", true, "sql_receive", "");
}
forward sql_receive(); public sql_receive()
{
print("Nome Matou Morreu Eagle Shotgun M4 Sniper Remedios Comida Vida Fome Sono");
static queryresult[12][50];
cache_get_data(numrows, numfields, connectionhandle);
for(new ii; ii != numrows; ii++)
{
cache_get_field_content(ii, "Nome", queryresult[0], connectionhandle);
cache_get_field_content(ii, "Matou", queryresult[1], connectionhandle);
cache_get_field_content(ii, "Morreu", queryresult[2], connectionhandle);
cache_get_field_content(ii, "Eagle", queryresult[3], connectionhandle);
cache_get_field_content(ii, "Shot", queryresult[4], connectionhandle);
cache_get_field_content(ii, "M4", queryresult[5], connectionhandle);
cache_get_field_content(ii, "Sniper", queryresult[6], connectionhandle);
cache_get_field_content(ii, "Remedios", queryresult[7], connectionhandle);
cache_get_field_content(ii, "Comida", queryresult[8], connectionhandle);
cache_get_field_content(ii, "Vida", queryresult[9], connectionhandle);
cache_get_field_content(ii, "Fome", queryresult[10], connectionhandle);
cache_get_field_content(ii, "Sono", queryresult[11], connectionhandle);
printf("%s - %02i - %02i - %02i - %02i - %02i - %02i - %02i - %02i - %f - %f - %f",
queryresult[0], queryresult[1], queryresult[2], queryresult[3], queryresult[4], queryresult[5],
queryresult[6], queryresult[7], queryresult[8], queryresult[9], queryresult[10], queryresult[11]);
}
return 0x01;
}