Faeroth Posted March 22, 2008 Share Posted March 22, 2008 Hello, SQL_RESET(1, "@count"); // Array reset. query_sql "SELECT count(`nameid`) FROM `inventory` WHERE `char_id` = '" + @char_id[@c]+ "'", @count; // Getting the amount of datasets. Works! set @current, 0; // OFFSET count reset. while(@current <= @count[0]) { // As long as there are datasets remaining. SQL_RESET(2, "@nameid", "@amount"); // Array reset. query_sql "SELECT `nameid` , `amount` FROM `inventory` WHERE `char_id` = '" + @char_id[@c] + "' LIMIT '" + @current + "' OFFSET 127", @nameid, @amount; // Does not work! set @current, @current + 127; // Next time start 127 onward. for( set @i, 0; @i < getarraysize(@nameid); set @i, @i + 1 ) mes @nameid[@i] + " -> " + @amount[@i]; // Return the datasets. Does not work! next; // Ignore this. } That's the idea: In this script language, there is a limit of 127 indexes for the arrays. Therefore I wanted to let MYSQL get only 127 datasets and the next time the following 127. The first MYSQL-Query works fine, but the second with the OFFSET does not. I guess I did not understand OFFSET correctly... Thanks in advance! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.