Forum Moderators: coopster
I'm trying to get database entries to list accross the page 4 table cells at a time.
<?php
echo '<table width="90%" border="0" cellpadding="4" align="center" class="ssi_table">
<tr>';
$array = ssi_boardNews(2.0, 20, null, 250, 'array');
$count = 0;
foreach ($array as $news)
if ($count <= 4)
{
echo '
<td align="center" valign="top" bgcolor="#E4EDFC"><b>
"<a href="', $news['href'], '">', $news['subject'], '</a>"</b><br>
<span class="smallprint"> posted by </span>', $news['poster']['link'], ' - ', $news['time'], ' ', $txt[525], $count ,'</td>';
$count = ($count + 1);
}
else
{
echo '</tr><td align="center" valign="top" bgcolor="#E4EDFC"><b>
"<a href="', $news['href'], '">', $news['subject'], '</a>"</b><br>
<span class="smallprint"> posted by </span>', $news['poster']['link'], ' - ', $news['time'], ' ', $txt[525], $count ,'</td>';
$count = ($count + 1);
}
echo ' </tr>
</table>
';
?>
Here is the code I've been playing with so far which doesn't help me much past post 4 as you may see.
I've been trying some use of the ¦¦ (or) operator in the if statement but obviously not correctly as my page just turns up blank.
Can anyone see a nice clean answer for me?
Cheers
Have a look at this one by jatar_k #1300710 on this page
I use it all the time, does exactly what you want I think