Patskie
Community Contributors
Hello i just want to request if this is possible. Why not implement a script command wherein it will get all results from a query_sql command. For example if a script do a query_command like the following :
query_sql "SELECT `name` FROM `char` WHERE `online` = '1'", .@name$;
From the query given above i must implement a for loop statement to go over with all the data.
for( set .@a,0; .@a < getarraysize(.@name$); set .@a,.@a + 1) mes "- " +.@name$[.@a];
My suggestions is this :
1. Implement a script command like ResultSet in java or DataReader on C#?
so if this will happen. It would look like these when i use the query given above : ( i would give ResultSet as an example )
ResultSet rs = query.getResultSet(); //Get the result from the query_sql commandwhile (rs.next()) { set .@names$ = rs.getString("name"); mes "Online Users : " +.@names$;} }
Or it may be :
ResultSet rs = query_sql("SELECT `name` FROM `char` WHERE `online` = '1'") // Direct Querywhile (rs.next()) { set .@names$ = rs.getString("name"); mes "Online Users : " +.@names$;} }
While the statement has next line get those and when they are in the name column then print them. Well for me it will be quite easy to make scripts
Anyway this is just a suggestion.
query_sql "SELECT `name` FROM `char` WHERE `online` = '1'", .@name$;
From the query given above i must implement a for loop statement to go over with all the data.
for( set .@a,0; .@a < getarraysize(.@name$); set .@a,.@a + 1) mes "- " +.@name$[.@a];
My suggestions is this :
1. Implement a script command like ResultSet in java or DataReader on C#?
so if this will happen. It would look like these when i use the query given above : ( i would give ResultSet as an example )
ResultSet rs = query.getResultSet(); //Get the result from the query_sql commandwhile (rs.next()) { set .@names$ = rs.getString("name"); mes "Online Users : " +.@names$;} }
Or it may be :
ResultSet rs = query_sql("SELECT `name` FROM `char` WHERE `online` = '1'") // Direct Querywhile (rs.next()) { set .@names$ = rs.getString("name"); mes "Online Users : " +.@names$;} }
While the statement has next line get those and when they are in the name column then print them. Well for me it will be quite easy to make scripts
Last edited by a moderator: