Solved

While Doesn' work

Posted on 2013-11-26
4
190 Views
Last Modified: 2013-11-26
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
Comment
Question by:Rodric MacOliver
  • 3
4 Comments
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39677337
Please try changing this line:

$diaCount = $diaCount++;

to this:

$diaCount++;
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39677338
Or you could change it to this (assuming you want a one-step iterator)

$diaCount = $diaCount + 1;
0
 

Author Closing Comment

by:Rodric MacOliver
ID: 39677364
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
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39677376
Glad to help, I've had a good night's sleep :-)

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

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question