问题
I want to insert data in database using perl &CGI but i have the following error : Undefined subroutine &Db::connection called at C:/wamp/bin/apache/apache2.2.22/cgi-bin/test.pl line 13.
test.pl
sub change{
my $Data = {
table =>'student',
action => 'insert',
data => {
Name => 'LL',
Surname => 'GG',
Age => '20'
}
};
return Db::update($Data);
};
sub test {
my $Data = {
table =>'student',
action => 'insert',
data => {
Name => 'LL',
Surname => 'GG',
Age => '20'
},
};
return Db::insert($Data);
};
print test();
just editet my code it now prints : INSERT INTO student (Name,Surname,Age) VALUES (LL,GG,20) but doesn't insert those data in database table
来源:https://stackoverflow.com/questions/17933671/undefined-subroutine-dbconnection-called