I think i answered your question. You told me what it should look like and i have provided a block a code that does exactly that and i have explained why your code does not work so it should not be hard to fix it yourself. If any other errors occur open a new thread.
Kinda hard to spot errors with improper code indentation and missing start tags.
From looking at it is because you put that code in a while loop. So its looping that code so 19 results times how ever times the while loop goes. To clear it up is some rows show up as 7 is because with 19 results...
<?php
// the number of results.
$noof = 19;
// the number of results in a row.
$ross = 6;
$i = 0;
for ($ii = 0; $ii < $noof; $ii++) {
$i++;
echo "{RESULT}";
if ($i % $ross == 0) {
echo "<br />";
}
}
?>
This will result in...