Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

While Doesn' work

Posted on 2013-11-26
4
Medium Priority
?
209 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 111

Accepted Solution

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

$diaCount = $diaCount++;

to this:

$diaCount++;
0
 
LVL 111

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 111

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

886 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