Re: if then isn't working
If you want to do alternating rows: if ($counter % 2) NOW if you want to do it at say every 5 rows: if ($counter % 5 === 0) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: if then isn't working
Thank you very much, I used your comments along with suggestions (and suggestions to comment :) ) to make it perfect. On Jan 31, 12:00 pm, brian wrote: > To add to Xoubaman's response, it's best if you specify *what* errors > you're getting if you want help. > > btw, if anyone's confused, "bucle" means "loop" (or "circuit") in french ;-) > > On Sat, Jan 31, 2009 at 11:13 AM, Xoubaman wrote: > > > echo("") only happens if $j==4, but echo(" > td>"); happens in every first bucle iterations, so you are > > closing lots os rows and columns. > > > On Jan 31, 3:56 pm, thankyou wrote: > >> ** im a beginner :) > > >> I'm trying to get this to make 20 rows of 5 colums each and I'm > >> continuing to get errors. Any idea what's wrong? Here's the code: > > >> > >> > >> > >> > >> >> $text = ' area code'; > >> for($i = 0; $i < 10; $i++) > >> { > >> for($j = 0; $j < 10; $j++) > >> { > > >> if($j == 4) > >> { > >> echo(""); > >> } > >> echo($html->link($firstNumber . $i. $j . > >> $text , "/AreaCodes/ > >> detail/". $firstNumber . $i. $j, array('class'=>'area_code_link'))); > >> echo(" "); > >> } > >> echo(""); > >> } > > >> ?> > >> > >> > >> > >> > > >> >> } > >> ?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: if then isn't working
Sorry, I wasn't clear enough. The error I was getting was just a blank page. I had the 1-10 for i and j as they are actually written in the columns. For example it would say 00, 01, 02, 03, 04 in the first row, then in the next row it would say 05, 06, 07, 08, 09 followed by the third row of 10, 11,12,13, etc... upto 99 How could I tweak the above for that? Thank you On Jan 31, 12:00 pm, brian wrote: > To add to Xoubaman's response, it's best if you specify *what* errors > you're getting if you want help. > > btw, if anyone's confused, "bucle" means "loop" (or "circuit") in french ;-) > > On Sat, Jan 31, 2009 at 11:13 AM, Xoubaman wrote: > > > echo("") only happens if $j==4, but echo(" > td>"); happens in every first bucle iterations, so you are > > closing lots os rows and columns. > > > On Jan 31, 3:56 pm, thankyou wrote: > >> ** im a beginner :) > > >> I'm trying to get this to make 20 rows of 5 colums each and I'm > >> continuing to get errors. Any idea what's wrong? Here's the code: > > >> > >> > >> > >> > >> >> $text = ' area code'; > >> for($i = 0; $i < 10; $i++) > >> { > >> for($j = 0; $j < 10; $j++) > >> { > > >> if($j == 4) > >> { > >> echo(""); > >> } > >> echo($html->link($firstNumber . $i. $j . > >> $text , "/AreaCodes/ > >> detail/". $firstNumber . $i. $j, array('class'=>'area_code_link'))); > >> echo(" "); > >> } > >> echo(""); > >> } > > >> ?> > >> > >> > >> > >> > > >> >> } > >> ?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: if then isn't working
The I and J both need to go from 0 to 9, as it need it to say 100, 101, 102, .999 in those rows. I don't think the below will do that since i is going upto 20 On Jan 31, 12:00 pm, brian wrote: > To add to Xoubaman's response, it's best if you specify *what* errors > you're getting if you want help. > > btw, if anyone's confused, "bucle" means "loop" (or "circuit") in french ;-) > > On Sat, Jan 31, 2009 at 11:13 AM, Xoubaman wrote: > > > echo("") only happens if $j==4, but echo(" > td>"); happens in every first bucle iterations, so you are > > closing lots os rows and columns. > > > On Jan 31, 3:56 pm, thankyou wrote: > >> ** im a beginner :) > > >> I'm trying to get this to make 20 rows of 5 colums each and I'm > >> continuing to get errors. Any idea what's wrong? Here's the code: > > >> > >> > >> > >> > >> >> $text = ' area code'; > >> for($i = 0; $i < 10; $i++) > >> { > >> for($j = 0; $j < 10; $j++) > >> { > > >> if($j == 4) > >> { > >> echo(""); > >> } > >> echo($html->link($firstNumber . $i. $j . > >> $text , "/AreaCodes/ > >> detail/". $firstNumber . $i. $j, array('class'=>'area_code_link'))); > >> echo(" "); > >> } > >> echo(""); > >> } > > >> ?> > >> > >> > >> > >> > > >> >> } > >> ?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: if then isn't working
To add to Xoubaman's response, it's best if you specify *what* errors you're getting if you want help. btw, if anyone's confused, "bucle" means "loop" (or "circuit") in french ;-) On Sat, Jan 31, 2009 at 11:13 AM, Xoubaman wrote: > > echo("") only happens if $j==4, but echo(" td>"); happens in every first bucle iterations, so you are > closing lots os rows and columns. > > On Jan 31, 3:56 pm, thankyou wrote: >> ** im a beginner :) >> >> I'm trying to get this to make 20 rows of 5 colums each and I'm >> continuing to get errors. Any idea what's wrong? Here's the code: >> >> >> >> >> >> > $text = ' area code'; >> for($i = 0; $i < 10; $i++) >> { >> for($j = 0; $j < 10; $j++) >> { >> >> if($j == 4) >>{ >> echo(""); >>} >> echo($html->link($firstNumber . $i. $j . >> $text , "/AreaCodes/ >> detail/". $firstNumber . $i. $j, array('class'=>'area_code_link'))); >> echo(" "); >> } >> echo(""); >> } >> >> ?> >> >> >> >> >> >> > } >> ?> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: if then isn't working
On Jan 31, 4:56 pm, thankyou wrote: > ** im a beginner :) > > I'm trying to get this to make 20 rows of 5 colums each and I'm > continuing to get errors. Any idea what's wrong? Here's the code: > > > > > > $text = ' area code'; for ( $i = 0; $i < 20; $i++ ) // Number of rows! > { > for($j = 0; $j < 10; $j++) > { > > if($j == 4) > { > echo(""); > } > echo($html->link($firstNumber . $i. $j . > $text , "/AreaCodes/ > detail/". $firstNumber . $i. $j, array('class'=>'area_code_link'))); > echo(" "); > } > echo(""); > } > > ?> > > > > > > } > ?> Correct your code! Use comments more, so you understand it yourself! for ( $i = 0; $i < 20; $i++ ) // Number of rows! 0 to 19 = 20 { echo ""; for ( $j = 0; $j < 5; $j++ ) // Number of columns in a row! 0 to 4 = 5 { echo ""; // Start of column echo $html->link($firstNumber . $i. $j . $text , "/AreaCodes/ detail/". $firstNumber . $i. $j, array('class'=>'area_code_link')); echo ""; // End of column } echo "\n"; // End of row } Next time, do write what errors you are getting! That will help a lot! Enjoy John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: if then isn't working
echo("") only happens if $j==4, but echo(""); happens in every first bucle iterations, so you are closing lots os rows and columns. On Jan 31, 3:56 pm, thankyou wrote: > ** im a beginner :) > > I'm trying to get this to make 20 rows of 5 colums each and I'm > continuing to get errors. Any idea what's wrong? Here's the code: > > > > > > $text = ' area code'; > for($i = 0; $i < 10; $i++) > { > for($j = 0; $j < 10; $j++) > { > > if($j == 4) > { > echo(""); > } > echo($html->link($firstNumber . $i. $j . > $text , "/AreaCodes/ > detail/". $firstNumber . $i. $j, array('class'=>'area_code_link'))); > echo(" "); > } > echo(""); > } > > ?> > > > > > > } > ?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
if then isn't working
** im a beginner :) I'm trying to get this to make 20 rows of 5 colums each and I'm continuing to get errors. Any idea what's wrong? Here's the code: "); } echo($html->link($firstNumber . $i. $j . $text , "/AreaCodes/ detail/". $firstNumber . $i. $j, array('class'=>'area_code_link'))); echo(" "); } echo(""); } ?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---