Hi,
I've searched the internet for a script that enables me to show a collection of links in two columns if there are over a certain number of links.
I have tried various things and am beginning to think that my day is destined to be VERY bad. I'm new to PHP so I haven't got the experience yet to notice if I'm making a very stupid mistake, but everyone tells me that will come with time and practice.
In the meantime if anyone could tell me if they notice anything stupid which is stopping my code from working I would be grateful.
What I want to do is show my links in two columns (I'm not doing the rest until I can get this bit sorted out). The problem is that all my text, links etc. are all going into the same column and not the sorting themselves out between the two.
Here's my code (sorry, I couldn't get the my PHP into the colours with the pop up window - see what I mean about a bad day? ) :
<?
include('connect.php');
$cat=1;
$souscat=2;
$result=mysql_query("SELECT * FROM $liens WHERE cat='$cat' AND souscat='$souscat' ");
$division_point = mysql_num_rows($result) / 2;
?><table><?
$i=0;
while ( $row = mysql_fetch_array($result) )
{
$item = sprintf("<a href='$row[4]'>".$row[3]."</a>");
if($i % $division_point) {
$b .= "$item";
}
else {
$a .= "$item";
} }
?>
<tr valign="top">
<td><font color="#000000"> <? echo $a; ?></font></td>
<td><font color="#000000"><? echo $b; ?></font></td>
</tr>
<? ?></table>
Any help would be MUCH appreciated. Sharon๐ ๐