It doesn't halve anything. It gives the remainder with 2 as divisor. This will be 0 if even, 1 if odd. So if djs_all_num
is odd, it will enter the if statement. You should write 2
instead. Using the implicit conversion from string to int is confusing and unnecessary.
Note that this does not operate per-row, since the left operand is the total row count, not the row index. To use a row index, do something like:
$row_ind = 0;
$djs_all_num = mysql_num_rows($djs_all_db);
while($djs_all = mysql_fetch_array( $djs_all_db )) {
if ($row_ind++ % 2) {