html - PHP: Split results of query into 2 columns -
i want load contacts query, whilst have found ways split amount of rows want result split 2 columns below them being sort of clickable button.is possible display query results described below use of html or query itself? :
contacts ------------------------------ albert smith | ben marshall benjamin jones | chris jones
i have tried 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 splits columns reaching half of results in 1 column , rest in column
albert smith | benjamin jones
ben marshall | chris jones
this not possible query itself. must parse result html <table>
, every 2 results make new <tr>
, double <td>
Comments
Post a Comment