two columns ???????

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

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

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

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>

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests