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
https://forums.phpfreaks.com/topic/263551-for-loop/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.