Jump to content

for loop


karimali831

Recommended Posts

Hi,

 

Can anyone understand what I'm trying to do in code?

I have difficulty explaining, trying to set variable for numbers starting with 0,1 in the sequence in for loop:-

 

Every number after the next you will see the pattern:

 

8

4

7

3

6

2

5

 

        for($i = 1; $i <= 8; $i++){

    $val = "LIMIT 0,1
            LIMIT 8,1
            LIMIT 4,1
            LIMIT 7,1
            LIMIT 3,1
            LIMIT 6,1
            LIMIT 2,1
            LIMIT 5,1";

    $clan_val = "LIMIT ".$val.",1";

    $query = "SELECT clan1 FROM ".PREFIX."cup_matches WHERE type='gs' AND $type_opp='0' AND matchno='{$ID}' ORDER BY clan1 ASC ".{$clan_val};
            safe_query($query);
        }

 

Hope you understand  8)

Link to comment
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.