InsanityInc
asked on
MySql through Perl
Alright, I'm trying to use Perl to draw info from a web form and use it to create a new record in a database, the MySql statement works just fine if I use it manually in a SQL editor, but the CGI script just stops dead at the portion of the script that has the useage of the SQL statement in it, the problematic part is as follows:
$dbh = DBI->connect("dbi:mysqlPP: database=c vdvbe;host =192.168.1 0.30", "fosters_web", "webaccess", {'RaiseError' => 1}) or
dienice("Can't connect: ",$dbh->errstr);
$sth = $dbh->prepare("insert into net_members values(NULL, 'new', '$b_name', '$b_add_1', '$b_add_2', '$b_city', '$b_state', '$b_zip', '$b_url', '$b_phone_a', '$b_phone_b', '$b_phone_c', '$b_phone_d', '$b_fax_a', '$b_fax_b', '$b_fax_c', '$b_contact', '$b_con_cell_a', '$b_con_cell_b', '$b_con_cell_c', '$b_con_email', '$b_naics', '$b_dvbe_num', '$b_dgs_num', '$b_dgs_exp_m', '$b_dgs_exp_d', '$b_dgs_exp_y', '$b_sb', '$b_sb_exp_m', '$b_sb_exp_d', '$b_sb_exp_y', '$b_mb', '$b_cmas', '$b_cmas_num', '$b_cmas_exp_m', '$b_cmas_exp_d', '$b_cmas_exp_y', '$b_dab_num', '$b_year_est');")
$dbh->errstr;
$rv = $sth->execute;
$sth->finish();
I don't know where the error is at exactly, since it doesn't generate an error, it just stops dead, doesn't go onto the next script, and doesn't create the entry, so can someone help me fix this, or tell me another way to do it?
$dbh = DBI->connect("dbi:mysqlPP:
dienice("Can't connect: ",$dbh->errstr);
$sth = $dbh->prepare("insert into net_members values(NULL, 'new', '$b_name', '$b_add_1', '$b_add_2', '$b_city', '$b_state', '$b_zip', '$b_url', '$b_phone_a', '$b_phone_b', '$b_phone_c', '$b_phone_d', '$b_fax_a', '$b_fax_b', '$b_fax_c', '$b_contact', '$b_con_cell_a', '$b_con_cell_b', '$b_con_cell_c', '$b_con_email', '$b_naics', '$b_dvbe_num', '$b_dgs_num', '$b_dgs_exp_m', '$b_dgs_exp_d', '$b_dgs_exp_y', '$b_sb', '$b_sb_exp_m', '$b_sb_exp_d', '$b_sb_exp_y', '$b_mb', '$b_cmas', '$b_cmas_num', '$b_cmas_exp_m', '$b_cmas_exp_d', '$b_cmas_exp_y', '$b_dab_num', '$b_year_est');")
$dbh->errstr;
$rv = $sth->execute;
$sth->finish();
I don't know where the error is at exactly, since it doesn't generate an error, it just stops dead, doesn't go onto the next script, and doesn't create the entry, so can someone help me fix this, or tell me another way to do it?
'NULL'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Well, it turns out everything was fine, I just forgot use DBI and use CGI at the top.
>80)
It is toooooo easy to do that!
Itatsumaki's advice is still good though... your script will execute better.
--
Martianism
It is toooooo easy to do that!
Itatsumaki's advice is still good though... your script will execute better.
--
Martianism