Re: continue after break
| From: | Dan Lowe | Date: | Thu, 23 Jan 2003 04:58:43 +0000 |
| Subject: | Re: continue after break | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-132746@lists.php.net to get a copy of this message | ||
You are misunderstanding how break and continue work. When you call break, the loop ends. When you call continue, the loop starts over, skipping the part between continue and the end of the loop.
When you call break, you're ending the loop. You never even get as far as continue (let alone as far as the second <TD> block).
On Thursday, January 23, 2003, at 12:02 AM, Remon Redika wrote:
I have put Image inside of my loop... <TD><image src="blabla.jpg"></td> and that image located between <?$row['field1?> and <?$row['field2']?> I want the image not doing loop too. cause i just need one image.., I just do looping for my data: <?$row['field1?> and <?$row['field2']?> <? while ($row = mysql_fetch_array($myquery)){ ?> <tr> <td class="subtitle" width="50%"> <?=$row['field1']?></td><?break;?> <td rowspan="2" valign="top" align="right"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <TD><image src="blabla.jpg"></td> </tr> </table> </td> </tr> <?continue;?> <tr><td class="body" width="50%"> <p align="justify"><?=$row['field2']?></p> </td></tr> <? }?>John W. Holmes writes:The solution is to take out your break... why is it there?? ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-----Original Message----- From: Reymond [mailto:reymond@unri.ac.id] Sent: Wednesday, January 22, 2003 10:45 PM To: php-general@lists.php.net Subject: [PHP] continue after break Hi everyone, I made a while loop and i'd like to know how to continue looping afterIbreak it, and . Here is my script : I found just break looping on my page, can't continue :( <? while ($row = mysql_fetch_array($myquery)){ ?><tr> <td class="subtitle" width="50%"> <?=$row['field1']?> </td><?break;?> <td rowspan="2" valign="top" align="right"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <TD><image src="blabla.jpg"></td> </tr> </table> </td></tr> <?continue;?> <tr> <td class="body" width="50%"> <p align="justify"><?=$row['field2']?></p> </td> </tr> <?}?> --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php