MySQL Forums
Forum List  »  Perl

Re: How to display returned rows in HTML page??
Posted by: Nick Roper
Date: April 30, 2005 02:36AM

Hi Naveen,

OK, once you have the data in the @record array you just need to print it out:

print $counter;

However, before doing that you need to generate the http headers for the page or you'll get an error. So, try :

#print the header (note the two \n\n escape sequences are importatnt - they tell the browser that the header has terminated and that what comes next is HTML)

print "Content-type: text/html\n\n";

#start the html for a table
print "<TABLE>\n";

#loop through the recorset returned by the query
while (@record = $sth->fetchrow()) {

$counter = $record[0];

print "<TR><TD>$counter</TD></TR>\n";


#close the html for the table
print "</TABLE>\n";

Hope this helps,


Nick Roper

Options: ReplyQuote

Written By
Re: How to display returned rows in HTML page??
April 30, 2005 02:36AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.