I'm having a strange problem when trying to delete a row out of a table using DBI
(version 1.35 under RH 8) and MySQL 4.01x
The Table:
create table SiteContact
(
Priority INT(11) auto_increment PRIMARY KEY,
Location VARCHAR(80),
ContactHeader VARCHAR(255),
ContactName VARCHAR(255),
EmailAddress VARCHAR(125),
)
>From the MySQL prompt if I delete from this table via:
"Delete from SiteContact where Priority = '15'"
Everything is fine, the row is removed.
If I do the same thing via DBI then below is what I see in the table for that
Priority Number.
15 | malden | NULL | NULL | NULL
|
So its not deleting the row and its nulling 3 out of 5 fields.
To make sure its not a permissions problem I made my DB connection as root, same
result.
Tried using placeholders to pass in the Priority as well as using the value directly.
Tried the syntax of "Delete * from .."
Tried using Location as part of the where statement "where Priority = ? and Location =
?".
I always get the same result (but only when using DBI).
Here is my delete code
$sth = $db->prepare("Delete from SiteContact where Priority = ?") or die "Can't
Prepare " . $sth->errstr();
$sth->execute($form_data{'contact_num'}) or die "Can't Execute " . $sth->errstr();
$sth->finish();
Any Ideas?
Thanks
-Chris