spewn
Programmer
- May 7, 2001
- 1,034
here's my code:
if the database is empty, it will add the first one...but will not add anything other than that.
any ideas?
the first field is an INT, and is the primary key, 7 digits long.
thanks!
- g
Code:
#!/usr/bin/perl
use CGI qw(:standard);
use CGI::Carp 'fatalsToBrowser';
use DBI;
$cgi = new CGI;
$dbh = DBI->connect("DBI:mysql:myDB:localhost","uname","pass");
$xname = $cgi->param('oName');
$xclink = $cgi->param('cLink');
$xglink = $cgi->param('gLink');
$xdesc = $cgi->param('oDesc');
$xinfo = $cgi->param('oInfo');
$xpaid = $cgi->param('aPaid');
$xprog = $cgi->param('aProg');
$sth2 = $dbh->prepare("INSERT INTO offers VALUES(0,'$xname','','$xclink','$xglink','$xdesc','$xinfo','','','$xpaid','$xprog','','')");
$sth2->execute;
print << "EOF";
Location: db-add.html
EOF
if the database is empty, it will add the first one...but will not add anything other than that.
any ideas?
the first field is an INT, and is the primary key, 7 digits long.
thanks!
- g