Undefined subroutine &Db::connection called

百般思念 提交于 2020-01-16 11:57:29

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!