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 Link to comment https://forums.phpfreaks.com/topic/59566-solved-i-dont-seem-to-understand-this/ 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"; } ?> Link to comment https://forums.phpfreaks.com/topic/59566-solved-i-dont-seem-to-understand-this/#findComment-295996 Share on other sites More sharing options...
The14thGOD Posted July 12, 2007 Author Share Posted July 12, 2007 thank you Link to comment https://forums.phpfreaks.com/topic/59566-solved-i-dont-seem-to-understand-this/#findComment-295998 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.