two columns ???????

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

djdejan
New php-forum User
New php-forum User
Posts: 7
Joined: Mon Mar 24, 2003 8:31 am

two columns ???????

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

How to print database results into two or more columns? (using html) :?:

DigitalRice
New php-forum User
New php-forum User
Posts: 29
Joined: Fri Jun 27, 2003 10:05 pm

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>


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron