From 7f024c8c6073c4fa1a4130c499a7f783e5a55ca1 Mon Sep 17 00:00:00 2001 From: toms Date: Sat, 29 Jul 2006 23:06:03 +0000 Subject: Removed ugly struct cast in login.c New version of buildin_query_sql which accept more than one column and can return the number of rows. See script_commands.txt for more details. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7975 54d463be-8e91-2dee-dedb-b68131a5f0ec --- doc/script_commands.txt | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'doc') diff --git a/doc/script_commands.txt b/doc/script_commands.txt index da9a8227c..9b742984c 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -4950,18 +4950,17 @@ Example: set @i, distance(100,200,101,202); --------------------------------------- -*query_sql "your MySQL query", -Returns up to 127 values into array. +*query_sql "your MySQL query", , [] +Returns up to 127 values into array and return the number of row Example: - -query_sql "SELECT name FROM 'char' ORDER BY fame DESC LIMIT 5", @most_fame_dude$; +set @nb, query_sql("select name,fame from `char` ORDER BY fame DESC LIMIT 5", @name$, @fame); mes "Hall Of Fame: TOP5"; -mes "1."+@most_fame_dude$[0]; // Will return a person with the biggest fame value. -mes "2."+@most_fame_dude$[1]; -mes "3."+@most_fame_dude$[2]; -mes "4."+@most_fame_dude$[3]; -mes "5."+@most_fame_dude$[4]; +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: It is available in SQL version only. Note: Use Text$[] array to recieve all data as text. -- cgit v1.2.3-60-g2f50