Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display output from SQL query in a dynamic table?

Status
Not open for further replies.

bioinfomatic

Programmer
Feb 15, 2005
1
GB
Hi,
Does anyone know how i can display the results of a SQL query in a table. Obviously the table would need to be dynamic as the query could return different number of rows each time. At the moment the results of the query are stored in an array. If anyone can help it would be appreciated as i can't get nowhere with creating a dynamic table.

Thanks
 
Something like this:

Code:
$sth->execute() or die "Cannot execute";
while (my (@rows) = $sth->fetchrow_array())
{
    print "<tr><td>$row[0]</td>"; #etc for all rows
    print "</tr>";
}
$sth->finish;

- Rieekan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top