# connect to DB, get $dbh # create table header print<<END; <table> <tr> <td>Column1 name</td> <td>Column2 name</td> </tr> END # then you fetch each row my $sth = prepare("select column1, column2 from table where condition = ?"); $sth->execute($condition); while my @row = ($sth->fetchrow_array) { print<<END; <tr> <td>$row[0]</td> <td>$row[1]</td> </tr> END } #then print footer print "</table>";
not tested, should work HTH Etienne Craig Sharp wrote: > > I need to create a script that will use DBI to retreive information from Informix >and then present the information in a table in html. > > The DBI part I have with no problem. > > I need to use perl to create a table in html that will expand or reduce as needed >depending on how many rows are retreived from the database. > In other words, I need the table to be dynamic and add or remove table rows for each >data row retreived. > > Can anyone provide an example of how to do this or point me in the right direction. > > Thanks, > > Craig A. Sharp > Unix Systems Administrator > DNS Administrator > Roush Industries > Office: 734-779-7282 > Cell: 734-231-6769 > Fax: 734-779-7807 > [EMAIL PROTECTED] > ==================================================== > I have not lost my mind, it's backed up on tape somewhere! > ==================================================== > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Etienne Marcotte Specifications Management - Quality Control Imperial Tobacco Ltd. - Montreal (Qc) Canada 514.932.6161 x.4001 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]