I want to load contacts from a query, Whilst I have found ways to split by the amount of rows I want the result to be split into two columns as below as well as them being a sort of clickable button.Is it possible to display the query results as described below by the use of HTML or by the query itself? :
Contacts
------------------------------
Albert Smith | Ben Marshall
Benjamin Jones | Chris Jones
I have tried the code below
<?
$rowcount = mysql_num_rows($records);
echo "<div id='column1'>";
$i = 0;
while ($d = mysql_fetch_object($records)) {
echo $d->name;
$i++;
if ($i == floor($rowcount / 2)) {
echo "</div><div id='colums2'>";
}
}
echo "</div>";
?>
But this splits the columns by reaching half of the results in 1 column and the rest in another column
Albert Smith | Benjamin Jones
Ben Marshall | Chris Jones