Ok,

I have connected to a MySQL database, and I am creating a table based on
the row fetched which is not a problem. But! How can I write a table
when multiple rows are fetched without writing a new table for each row?
Here is the code I am using at the moment. I had it wrapped with a while
statement, but that wrote a table for each row.


CURRENT CODE:
@row = $query->fetchrow_array();
print $cgi->table({-border=>'1'},
      Tr({-align=>LEFT, -valign=>MIDDLE},
      [
        
td({-bgcolor=>green,-width=>'150'},["$row[0]","$row[1]","$row[2]","$row[3]"])

      ]
      )
     );
print $cgi->end_table;

CODE TO WRITE A TABLE FOR EACH ROW: (Not used at the moment)

while(@row = $query->fetchrow_array()) {
print $cgi->table({-border=>'1'},
      Tr({-align=>LEFT, -valign=>MIDDLE},
      [
        
td({-bgcolor=>green,-width=>'150'},["$row[0]","$row[1]","$row[2]","$row[3]"])

      ]
      )
     );
print $cgi->end_table;
}
-- 
------
James Kelty
Sr. Unix Systems Administrator
The Ashland Agency
[EMAIL PROTECTED]

Reply via email to