kiat has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I've a column in a mysql database that gets updated when it shouldn't have been. I've pasted the table specs and the relevant perl code here:# table specs CREATE TABLE tasks ( member_id MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, quota MEDIUMINT NOT NULL, logged TIMESTAMP NULL, ); # perl code to decrease quota by 1 my $member_id = get_memberid(); my $sql = qq{ UPDATE tasks SET quota=quota-1 WHERE member_id=? }; # Assuming a connection via $dbh exists $dbh->do($sql, undef, $member_id);
With the perl code above, 'quota' gets decremented by 1, which is correct, but 'logged' gets updated with the currect timestamp too, which is not what I intended.
Am I missing something?Updated: Thanks! It makes sense now :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI mysql question
by matija (Priest) on Mar 03, 2004 at 09:51 UTC | |
|
Re: DBI mysql question
by neniro (Priest) on Mar 03, 2004 at 09:43 UTC | |
|
Re: DBI mysql question
by Tomte (Priest) on Mar 03, 2004 at 09:43 UTC | |
|
Re: DBI mysql question
by markov (Scribe) on Mar 03, 2004 at 10:01 UTC | |
|
Re: DBI mysql question
by castaway (Parson) on Mar 03, 2004 at 12:33 UTC | |
by mpeppler (Vicar) on Mar 03, 2004 at 16:19 UTC |