Organizing data returned from a while loop.

General discussions related to php

Moderators: macek, egami, gesf

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Tables...

Postby ruturajv » Fri Jul 04, 2003 5:42 am

ok for this

Code: Select all

while ($row=mysql_fetch_assoc($result)) {
  echo("<table><tr><td>");
  echo($row['somecolumn']);
  echo("</table>");
  echo("<table><tr><td>");
  echo($row['othercolumn']);
  echo("</table>");

I think this shall help!!
:D

daveyboy
New php-forum User
New php-forum User
Posts: 6
Joined: Sat Jul 05, 2003 12:57 am

Postby daveyboy » Sat Jul 05, 2003 1:20 am

not sure that would work out quite right, I have this sort of thing a lot:

Code: Select all

print "<table>";
while ($row=mysql_fetch_assoc($result)) {
    print "<tr><td>";
    print $row["col1"];
    print "</td><td>";
    print $row["col1"];
    print "</td></tr>";
}
print "</table>";


works for me at least :p


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron