J
JimJx
Hi again all,
I am still working on the DB and ran intpo anpther problem that I hope
you all can assist with...
I have a table that consists of 13 columns, the last column being an
autoincrement field 'ID'
Now I have a form on my site that passes data to the script. The
script is supposed to insert the new data into "ID" but that doesn't
happen for some reason. I know that the data being passed is accurate
because I put a print statement in and it worked fine. It just isn't
making it into the DB.
No errors, nada.....
Any suggestions?
Thanks!
Jim
sub Update() {
my $dbh = DBI->connect('DBI:mysql:mydb',$DBuser, $DBpass)
or die "Couldn't connect to database: " . DBI->errstr;
my $sth = $dbh->prepare( 'UPDATE valley SET Category="$Category",
Name="$Name", Description="$Description", Contact="$Contact",
Phone="$Phone", Fax="$Fax", Address="$Address", City="$City",
State="$State", ZipCode="$ZipCode", Email="$Email", URL="$URL",
Keywords="$Keywords" where ID = "$ID"' )or die "Couldn't prepare: " .
DBI->errstr;
$sth->execute()or die "Couldn't execute: " . DBI->errstr;;
$sth->finish ( );
$dbh->disconnect;
print "Category=$Category, Name=$Name, Description=$Description,
Contact=$Contact, Phone=$Phone, Fax=$Fax, Address=$Address, City=
$City, State=$State, ZipCode=$ZipCode, Email=$Email, URL=$URL,
Keywords=$Keywords, ID=$ID";
&Bottom;
exit;
}
I am still working on the DB and ran intpo anpther problem that I hope
you all can assist with...
I have a table that consists of 13 columns, the last column being an
autoincrement field 'ID'
Now I have a form on my site that passes data to the script. The
script is supposed to insert the new data into "ID" but that doesn't
happen for some reason. I know that the data being passed is accurate
because I put a print statement in and it worked fine. It just isn't
making it into the DB.
No errors, nada.....
Any suggestions?
Thanks!
Jim
sub Update() {
my $dbh = DBI->connect('DBI:mysql:mydb',$DBuser, $DBpass)
or die "Couldn't connect to database: " . DBI->errstr;
my $sth = $dbh->prepare( 'UPDATE valley SET Category="$Category",
Name="$Name", Description="$Description", Contact="$Contact",
Phone="$Phone", Fax="$Fax", Address="$Address", City="$City",
State="$State", ZipCode="$ZipCode", Email="$Email", URL="$URL",
Keywords="$Keywords" where ID = "$ID"' )or die "Couldn't prepare: " .
DBI->errstr;
$sth->execute()or die "Couldn't execute: " . DBI->errstr;;
$sth->finish ( );
$dbh->disconnect;
print "Category=$Category, Name=$Name, Description=$Description,
Contact=$Contact, Phone=$Phone, Fax=$Fax, Address=$Address, City=
$City, State=$State, ZipCode=$ZipCode, Email=$Email, URL=$URL,
Keywords=$Keywords, ID=$ID";
&Bottom;
exit;
}