hello
I am trying to display some form values. Of course no problem I can display that particular data by using That my following code it is perfectly working. but I need to display those data in two column.Actually those data containing Names.I need to put those name according their First name A to M in first column and N - Z names are second column
ex-
|Column A | Column B |
| A | N |
| B | O |
| C | P |
| . | . |
| . | . |
| M | Z |
I am try to use while loop for it.
<table>
<?php
require "conetion.php";
$query = "SELECT * FROM forms WHERE active = '1' ORDER BY Name ASC";
$result=mysql_query ($query);
$total_rows = mysql_num_rows($result);
$count = 1;
while($row = mysql_fetch_array($result))
{
if($count==1 || $count%2==1)
{
echo '<tr>';
}
//echo "<td>". $row['text_2'] . "</td>";
echo "<td>";
echo '<div >'.$row['Name'].'</div>';
echo "</td>";
if($count == $total_rows || $count%2 == 0)
{
echo '</tr>';
}
$count++;
}
?> </table>
Ok I am agree with you here in my code I had lot of mistake.ok If can tell me either very better way to achieve this my requirement or other proper solution I am so glad.
cheers.
Umanda Jayo Bandara