Solved

While Doesn' work

Posted on 2013-11-26
4
186 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:R Wolf
  • 3
4 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
Please try changing this line:

$diaCount = $diaCount++;

to this:

$diaCount++;
0
 
LVL 108

Expert Comment

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

$diaCount = $diaCount + 1;
0
 

Author Closing Comment

by:R Wolf
Comment Utility
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 108

Expert Comment

by:Ray Paseur
Comment Utility
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 Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now