Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

two columns ???????

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

two columns ???????

Postby djdejan » Sun Sep 14, 2003 7:09 am

How to print database results into two or more columns? (using html) :?:
djdejan
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Mar 24, 2003 8:31 am

Postby DigitalRice » Sun Sep 14, 2003 8:51 am

ex:

<table>
Code: Select all
<?php
   $query = "SELECT fname, lname, mi FROM members";

   $result = mysql_query($query) or die ("Cannot get member data from members. <b> $query</b> " . mysql_error());
   
   while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
       echo ("<tr>");
       echo ("<td>" . $row['fname'] . "</td>");
       echo ("<td>" . $row['lname'] . "</td>");
       echo ("<td>" . $row['mi'] . "</td>");
       echo ("</tr>\n");
   }
?>
</table>
DigitalRice
New php-forum User
New php-forum User
 
Posts: 29
Joined: Fri Jun 27, 2003 10:05 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron