#!perl -wT use CGI; use CGI::Carp qw ( fatalsToBrowser ); use DBI; use strict; my $q = new CGI; my %attr = (RaiseError=>1, PrintError=>1); my @field_name = qw ( property_id address_1 address_2 county city zip description status bedroom bathroom ); my @field_desc = qw ( ID Address Address County City PostalCode Description Status Bedrooms Bathrooms ); my $dbh = DBI->connect("dbi:mysqlPP:$db:$server", $username, $password,{RaiseError =>1}); print $q->header("text/html"), $q->start_html(-title=>"Lettingsetc.co.uk | Admin | Edit", -src=>"/mycss.css"), $q->h1("Lettingsetc.co.uk"), $q->h4("Administration>Edit property details!"); my $field_list = join (",", @field_name); print <All Properties HTML my $SQL = "SELECT $field_list FROM property"; my $i; foreach $i(@field_desc) { print "\n"; } print qq ``; my $sth = $dbh->prepare($SQL); $sth->execute() or die $dbh->errstr; my $row; foreach $row( $sth->fetchrow_array)# while more rows fetch next one { print "\n";# print row data in HTML } print "
$i
$row
"; print $q->end_html; $dbh->disconnect() or die $dbh->errstr;