OK, this code below sits in a loop and basically I'm incrementing X and checking each time if X is divisible by 4.
The way I imagine the code to work, is it will print the word "test" and put in a <tr> every time it gets to a number divisible by four. When it's not divisible by four, I imagine it will print all the $title and $animator stuff.
What in actual fact it IS doing, is the complete opposite.
It's writing the word "test" and putting a <tr> in for EVERY time thru the loop except the times when X is divisible by 4.
How confusing...
Any ideas?
thanks
(below sits in a for loop that scans thru the database)
Code: Select all
if ($x % 4) //is X divisible by 4?
{ //if it is do this
print "test<br>";
print "<tr>";
}
else //if it's not do this
{
print "<td valign="top">";
print "<a href = "/files/$year/$month/$mpg"><img src=/files/$year/$month/$jpg></a>";
print "<br>";
print "$title<br>";
print "<b>$animator</b><br>";
print "<br>";
print "<br>";
print "</td>";
}
$x = $x + 1;