Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Organizing data returned from a while loop.

General discussions related to php

Moderators: macek, egami, gesf

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
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

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
daveyboy
New php-forum User
New php-forum User
 
Posts: 6
Joined: Sat Jul 05, 2003 12:57 am


Return to PHP General

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

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