Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

While Doesn' work

Posted on 2013-11-26
4
Medium Priority
?
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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 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…

722 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