Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

While Doesn' work

Hi folks, for some reason I can't seam to find where the error is, I know it is a logical error since I'm getting an infinite loop, but I'm just stranded in finding it...


$dia = 1;
	$diaCount = 1;
	$countCapitulo = 1;
	while($diaCount<20){
			if($diaCount != 16){
				//	if($diaCount != 23){
							$countCapitulo = $countCapitulo++;
							echo "<a href=\"$final\">CapĂ­tulo: $countCapitulo</a>";
							echo "\n";
							echo "<br/>";
				//	};
				};
			$dia = $dia++;			
			$diaCount = $diaCount++;
	};

Open in new window


Any help would be greatly appreciated.
0
Rodric MacOliver
Asked:
Rodric MacOliver
  • 3
1 Solution
 
Ray PaseurCommented:
Please try changing this line:

$diaCount = $diaCount++;

to this:

$diaCount++;
0
 
Ray PaseurCommented:
Or you could change it to this (assuming you want a one-step iterator)

$diaCount = $diaCount + 1;
0
 
Rodric MacOliverResearcherAuthor Commented:
Cheers Ray, as usual you really came through for me.

I simply couldn't see it, probable from programming during the wee hours of the night...
Anyway cheers!
0
 
Ray PaseurCommented:
Glad to help, I've had a good night's sleep :-)

Thanks for the points and thanks for using EE, ~Ray
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now