fixing insert bug

This commit is contained in:
chris 1999-12-21 21:31:45 +00:00
parent 6d6fab2b94
commit 77447a6532
2 changed files with 3 additions and 3 deletions

View file

@ -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',";
}
}

View file

@ -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";