Quote:
Originally Posted by Larrysw
tthat search does not work.
Edit I found this code that will and won't work it works with out the templeat but with it it doesn't start a new row heres my code:
PHP Code:
$counter=3; $rows = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "table WHERE active='1'"); while ($row = $db->fetch_array($rows)) { if($counter % 3 == 0){ echo "<tr>"; } ?> <td> <?php echo $row['name']; ?> </td> <?php if($counter % 3 == 0){ echo "</tr>"; $counter=1; } $counter++; }
|
The modulus operator is the proper way to do this. My guess is you were not appending the next row to the output variable with .= instead of =. But you haven't posted the templated version.