From 62eecf24480520e204ab0057f8f7845c13f37c13 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Sat, 19 Feb 2005 00:01:47 +0000 Subject: Bug 280494: Replace "SELECT LAST_INSERT_ID()" with Bugzilla::DB function call Patch By Tomas Kopal r=mkanat, a=justdave --- attachment.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'attachment.cgi') diff --git a/attachment.cgi b/attachment.cgi index 5e10d8fee..3522f9e26 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -869,7 +869,8 @@ sub insert my ($data) = @_; # Insert a new attachment into the database. - + my $dbh = Bugzilla->dbh; + # Escape characters in strings that will be used in SQL statements. $filename = SqlQuote($filename); my $description = SqlQuote($::FORM{'description'}); @@ -886,8 +887,7 @@ sub insert VALUES ($::FORM{'bugid'}, $sql_timestamp, $filename, $description, $contenttype, $::FORM{'ispatch'}, $isprivate, $::userid, $thedata)"); # Retrieve the ID of the newly created attachment record. - SendSQL("SELECT LAST_INSERT_ID()"); - my $attachid = FetchOneColumn(); + my $attachid = $dbh->bz_last_key('attachments', 'attach_id'); # Insert a comment about the new attachment into the database. my $comment = "Created an attachment (id=$attachid)\n$::FORM{'description'}\n"; -- cgit v1.2.3-24-g4f1b