#!/usr/bin/perl -Tw
-# $Id: persons.cgi,v 1.6 1999-04-22 05:54:53 ivan Exp $
+# $Id: persons.cgi,v 1.7 1999-04-22 05:58:06 ivan Exp $
# Copyright (c) 1999 Ivan Kohler. All rights reserved.
# This program is free software; you can redistribute it and/or modify it under
# the same terms as perl itself
unless ( $cgi->param('magic') ) { #first time through
- my $sth = $dbh->prepare( "SELECT * FROM PERSONS" )
+ my $sth = $dbh->prepare( "SELECT * FROM $table" )
or die $dbh->errstr;
my $rv = $sth->execute;
die $sth->errstr unless $rv;
$cgi->param( $field, $1);
}
}
- my $statement = 'INSERT INTO PERSONS ( '.
+ my $statement = "INSERT INTO $table ( ".
join(', ', @fields ).
' ) VALUES ( '.
join( ', ', map { $dbh->quote($cgi->param($_)) } @fields ).