HELP PLEASE: Display record field in two column??
Posted: Tue Feb 17, 2009 12:42 pm
Hi,
I have a problem, in my table there is a field called 'firstname' and I use the follow code to loop through the table and display the value of the field on a page and everything looks good, but now i want to display the field in two column format instead of one, I don't know how to do it.
Do I need two different loop/ do while?
I want the page display as follow two columns instead of one column, each value is from different record of the table.
===========================================
Firstname1 Firstname 2
Firstname3 Firstname 4
Firstname5 Firstname 6
===========================================
$result = mysql_query($sql) or die(mysql_error()."<br>$sql");
while ($rows = mysql_fetch_array($result))
{
<tr>
<td> </td>
<td>
<a href="<?php echo $url; ?>"><?php echo $rows['firstname']; ?></a>
<br>
</td>
</tr>
<?php
}
?>
Thanks!
I have a problem, in my table there is a field called 'firstname' and I use the follow code to loop through the table and display the value of the field on a page and everything looks good, but now i want to display the field in two column format instead of one, I don't know how to do it.
Do I need two different loop/ do while?
I want the page display as follow two columns instead of one column, each value is from different record of the table.
===========================================
Firstname1 Firstname 2
Firstname3 Firstname 4
Firstname5 Firstname 6
===========================================
$result = mysql_query($sql) or die(mysql_error()."<br>$sql");
while ($rows = mysql_fetch_array($result))
{
<tr>
<td> </td>
<td>
<a href="<?php echo $url; ?>"><?php echo $rows['firstname']; ?></a>
<br>
</td>
</tr>
<?php
}
?>
Thanks!