The14thGOD Posted July 12, 2007 Share Posted July 12, 2007 I'm trying to get this so that in a while loop, theres a variable that is added each time a row from the database is present and displayed it adds one too it. now i want it if it's divisible by 2 it will make a new row, here's the code I'm using, it works for if it's divisible by 4...so im kind of confused, if anyone could explain it a bit, that would be helpful: <?php if (!(($x-1) % 2)) { echo("</tr>\n"); echo("<tr>\n"); }?> Thanks, Justin Quote Link to comment Share on other sites More sharing options...
trq Posted July 12, 2007 Share Posted July 12, 2007 <?php if (($x % 2) == 0) { echo "</tr>\n"; echo "<tr>\n"; } ?> Quote Link to comment Share on other sites More sharing options...
The14thGOD Posted July 12, 2007 Author Share Posted July 12, 2007 thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.