A php custom function returns record set from a mysql query.
I need to populate a two column table having equal quantity or balanced between two.
I know we can split by number of columns the row count then use a loop to populate each td accordingly.
Any suggestions or most practical way to display record sets onto tables organized according to their sizes?
Not using templates at this time.
Basically need to control the TD tag from been echo or not and filled.
Sample Code:
$col_num = 2; //Number of colums to parse data onto.
$count_r = mysql_num_rows($result)/$col_num;
echo '<table style="width:400px;border:3px solid green;"><tr><td>';
$ui=1;
while($row = mysql_fetch_array($result))
{
if($ui<$count_r)
{
echo '<input disabled type="checkbox" value="$row[id]"'; $this->ischecked($uid,$row[id]); echo "/>".$row['name'].'<br>'."\r\n";
}
$ui++;
}
//FIRST COLUMN SET
echo '</td>';
echo '<td>';
//SECOND COLUMN SET
echo '</td></tr></table>';