karimali831 Posted June 2, 2012 Share Posted June 2, 2012 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 Link to comment https://forums.phpfreaks.com/topic/263551-for-loop/ Share on other sites More sharing options...
requinix Posted June 2, 2012 Share Posted June 2, 2012 Are you trying to order the results in a certain way? What way? Link to comment https://forums.phpfreaks.com/topic/263551-for-loop/#findComment-1350668 Share on other sites More sharing options...
smoseley Posted June 2, 2012 Share Posted June 2, 2012 Nope. Don't understand in the least. Link to comment https://forums.phpfreaks.com/topic/263551-for-loop/#findComment-1350674 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.