summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authortoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-29 23:06:03 +0000
committertoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-29 23:06:03 +0000
commit7f024c8c6073c4fa1a4130c499a7f783e5a55ca1 (patch)
tree0ce117b29e4080cc80e7becafe43c0b4f215dbd6 /doc
parent84e7380a76a1e3f5740c0a144d79405ddc4c82a2 (diff)
downloadhercules-7f024c8c6073c4fa1a4130c499a7f783e5a55ca1.tar.gz
hercules-7f024c8c6073c4fa1a4130c499a7f783e5a55ca1.tar.bz2
hercules-7f024c8c6073c4fa1a4130c499a7f783e5a55ca1.tar.xz
hercules-7f024c8c6073c4fa1a4130c499a7f783e5a55ca1.zip
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
Diffstat (limited to 'doc')
-rw-r--r--doc/script_commands.txt17
1 files changed, 8 insertions, 9 deletions
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", <array name>
-Returns up to 127 values into array.
+*query_sql "your MySQL query", <array name>, [<array name>]
+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.