Search the Commands

Home  All  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z 

Details for command query_sql:
* query_sql "Query"{,<array>{,<array>{,...}}};
* query_logsql "your MySQL query", <array variable> {,<array variable>, ...};
Puts up to 128 rows of values into the arrays and returns the number of rows.

set @nb, query_sql("select name,fame from `char` ORDER BY fame DESC LIMIT 5", @name$, @fame);
mes "Hall Of Fame: TOP5";
mes "1."+@name$[0]+"("+@fame[0]+")"; // Will return a person with the biggest fame value.
mes "2."+@name$[1]+"("+@fame[1]+")";
mes "3."+@name$[2]+"("+@fame[2]+")";
mes "4."+@name$[3]+"("+@fame[3]+")";
mes "5."+@name$[4]+"("+@fame[4]+")";

Note: In the TXT version it doesn't fill the array and always return -1.
Note: Use $ as suffix in the array to receive all data as text.
Note: The difference between query_sql and query_logsql is that the latter
uses the sql connection to the log database, and should be used when you want
to query the server log tables.

Valid XHTML 1.0 Strict Valid CSS!