Jump to content

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/97377-offset/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.