From 77447a65322c4d3fdcff6b51cbae43c09d21e75e Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 21 Dec 1999 21:31:45 +0000 Subject: [PATCH] fixing insert bug --- C4/Database.pm | 4 ++-- insertdata.pl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Database.pm b/C4/Database.pm index c25096b..320a228 100755 --- a/C4/Database.pm +++ b/C4/Database.pm @@ -66,14 +66,14 @@ sub sqlinsert { my $dbh=C4Connect; my $query="INSERT INTO $table \("; while (my ($key,$value) = each %data){ - if ($key ne 'type'){ + if ($key ne 'type' && $key ne 'updtype'){ $query=$query."$key,"; } } $query=~ s/\,$/\)/; $query=$query." VALUES ("; while (my ($key,$value) = each %data){ - if ($key ne 'type'){ + if ($key ne 'type' && $key ne 'updtype'){ $query=$query."'$value',"; } } diff --git a/insertdata.pl b/insertdata.pl index 803f966..ce41f23 100755 --- a/insertdata.pl +++ b/insertdata.pl @@ -53,7 +53,7 @@ if ($data{'type'} eq 'biblio'){ $keyfld = "borrowernumber"; } else { my $bornum=getmax('borrowers','borrowernumber'); - my $num=$bornum->{'max'}; + my $num=$bornum->{'max(borrowernumber)'}; $num++; $data{'borrowernumber'}=$num; $data{'branchcode'}="L";