I think I've been looking at this code for too long, I'm totally missing where my error is. The code executes, but none of the rows are updated. No error is returned either, I printed the data as it went through, all the id's match up in the database. I'm not truncating the strings anywhere. I've gotta be missing something or smoking too much crack.
for (@usercodelist) { my $SQL = "UPDATE mytable SET subscribed = '0', unsubscribedby = 'SY +STEM' WHERE usercode = '$_' AND unsubscribedby = ''"; my $sth = $DBH->prepare($SQL); $sth->execute || die "Could not execute SQL statement ... maybe inva +lid?<BR>$!"; $sth->finish(); }
The @usercodelist array is a list of MD5 hashes, the database is MySQL.
Field DataType ----- -------- subscribed tinyint(1) usercode varchar(32) binary subscribedby varchar(32) binary unsubscribedby varchar(32) binary unsubscribedby varchar(32) binary
Sample Row:
subscribed usercode subscribed by unsubscrib +ed by 1 7436692b91879380d9108739eb9865f5 SYSTEM
Thanks in advance!!
--
paul
In reply to DB Not UPDATE-ing by vbrtrmn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |