#!/usr/local/bin/perl ############################################################################# # Generic SQL access to Database # output can either be HTML table (or) XML # Written by: Sam Sultan ############################################################################# use CGI "param"; use DBI; $DBdriv = 'mysql'; $DBname = param('db'); $DBuser = param('user'); $DBpswd = param('pswd'); $DBhost = param('host'); $DBport = param('port'); $sql = param('sql'); $output = param('output'); $output = 'HTML' if (! $output); # if not supplied use HTML $output = uc($output); # convert to upper case if ($output eq 'HTML') { #if HTML output print "Content-type: text/html \n\n"; print "
Cannot open database connection - $DBI::errstr"; print " |
---|