Lines 1503-1508
sub _isbn_cleanup {
Link Here
|
1503 |
return; |
1503 |
return; |
1504 |
} |
1504 |
} |
1505 |
|
1505 |
|
|
|
1506 |
=head2 NextSequentialNumber |
1507 |
|
1508 |
Returns the next sequential number in a range (subranges possible) |
1509 |
|
1510 |
my $sh= NextSequentialNumber('shelfnumber'); |
1511 |
my $loc= NextSequentialNumber('shelflocation', $sh); |
1512 |
|
1513 |
=cut |
1514 |
|
1515 |
sub NextSequentialNumber { |
1516 |
my ($range, $subrange)= @_; |
1517 |
|
1518 |
my $sql=q/ |
1519 |
UPDATE sequential_numbers set counter= LAST_INSERT_ID(counter+1) |
1520 |
/; |
1521 |
my $dbh= C4::Context->dbh; |
1522 |
#my $dbname= C4::Context->config("database"); |
1523 |
|
1524 |
$dbh->do($sql); |
1525 |
#return $dbh->last_insert_id(undef, undef, 'sequential_numbers', 'counter'); |
1526 |
return $dbh->last_insert_id(undef, undef, undef, undef); |
1527 |
#first parameter could have been $dbname (MySQL ignores it) |
1528 |
#actually third and fourth are also ignored |
1529 |
} |
1530 |
|
1531 |
|
1532 |
|
1506 |
1; |
1533 |
1; |
1507 |
|
1534 |
|
1508 |
__END__ |
1535 |
__END__ |
1509 |
- |
|
|