#!/usr/bin/perl print "Content-type: text/html\n\n"; use CGI qw(:standard -debug); use strict; use DBI; #declare variables my ($key, @sysletter, $systems, $dbh, $dsn); my $row = param('row'); my $action = param('action'); my $value = param('value'); #assign initialization string username and password to variables my $dsn = "DBI:mysql:IST221"; my $user_name = "ist221student"; my $password = "password"; my $dbh = DBI->connect($dsn, $user_name, $password); #preparing and executing the statement. if ($action eq "v") { my $sth = $dbh ->prepare("SELECT * FROM products order by pname"); $sth->execute(); print "\n"; print "
\n"; print qq(); while (my @row = $sth -> fetchrow_array()) { print qq(

",$row[4]; } } elsif ($action eq "a") { print "Location: http://carrotcake.nsm.tridenttech.edu/tablefunction.cgi\n\n"; } elsif ($action eq "u") { print "this is the update page under construction\n"; } elsif ($action eq "d") { print "this is the delete page under construction\n"; } else { print "Error!\n"; } print qq (

ProductU/IQuantiyCost
$row[1]$row[2] $row[3]); printf "%.2f
); print "\n"; print "\n"; print "Return to Selection Page"; print "\n";