fixing insert bug
This commit is contained in:
parent
6d6fab2b94
commit
77447a6532
2 changed files with 3 additions and 3 deletions
|
@ -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',";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue