Hi to All,
I' d like to create a table in which put the data read from a database
using Perl Object-Oriented language.
Now I' ve created this functional table, and I' d like to re-write it in
object-oriented:
use CGI;
use Win32::ODBC;
my $q = new CGI;
$db = new Win32::ODBC("DSN=connection.dsn;")
or die Win32::ODBC::Error();
if ($db->Sql("SELECT Nation, Area, Permit FROM table
WHERE Nation LIKE '%@{[$q->param('nation')]}%' AND Area
LIKE'%@{[$q->param('area')]}%'")) {
print "SQL Error: " . $db->Error() . "\n";
$db->Close();
exit;
}
print $q->header("text/html"),
$q->start_html("Title");
print "<table>" ,
"<tr bgcolor=ffffcc align=center>" .
"<td>Nation</td>" . "<td>Area</td>" . "<td>Permit</td></tr>";
while ($db->FetchRow){
my ($Nation, $Area, $Permit) = $db->Data();
print "<tr bgcolor=white align=center>" .
"<td>$Nation</td>" . "<td>$Area</td>" . "<td>$Permit</td></tr>";
}
print "</table>";
print $q->end_html;
$db->Close();
----> I'd like to re-write table using this sintax:
print $q->table(
{-border => 1},
$q->Tr([
$q->th({-bgcolor => "#ffffcc"},
["Nation", "Area", "Permit"]),
]),
$q->Tr([
$q->th({-bgcolor => "#ffffff"}),
$q->td(["Nation", "Area", "Permit"]),
])
);
ecc..
Can someone help me?
Thanks in advance !!
Bye
Angelo
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]