Error while inserting perl variable in the mysql table on html page

204 views Asked by At

Error while inserting email address in the table

**[perl] my $username=$CGI->{salesrep}; return $username;[/perl]@gmail.com**

I want to insert this value in the table.

But It gives null when executed.

[query type=list sql="INSERT tech4less.outofstock_sku SET name='[value name]',customer_email='[value email]', phone='[value phone]', state='[value b_state]', postalcode='[value zip]', country='[value country]', **salesperson='[perl]$username[/perl]@gmail.com**', product='[value wish_product]', item_description='[value wish_descrip]', manufacturer='[value wish_man]',  category = '[value wish_cat]', business_yn='[value option]', date = now()"]

[/query]

1

There are 1 answers

2
user1126070 On

If $CGI is a CGI object then access a parammeter this way:

my $username=$CGI->param('salesrep');

Read this: http://perldoc.perl.org/CGI.html#FETCHING-THE-VALUE-OR-VALUES-OF-A-SINGLE-NAMED-PARAMETER:

Regards