From a842d008042579def706fce50017fc039f353cda Mon Sep 17 00:00:00 2001 From: briandilley Date: Tue, 7 Dec 2004 04:18:34 +0000 Subject: [PATCH] Fixed insert_id problem that randomly surfaced. --- kwotes-lib.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kwotes-lib.pl b/kwotes-lib.pl index 9499fb8..819b200 100755 --- a/kwotes-lib.pl +++ b/kwotes-lib.pl @@ -184,8 +184,12 @@ sub add_kwote { # execute $sth->execute() or return undef; + # get the id + my $insert_id = ($dbh->{'mysql_insertid'}) ? + $dbh->{'mysql_insertid'} : $sth->insert_id; + # return the id - return $sth->{insertid}; + return $insert_id; } ##