View | Details | Raw Unified | Return to bug 8533
Collapse All | Expand All

(-)a/C4/Members.pm (-5 / +1 lines)
Lines 899-909 sub fixup_cardnumber { Link Here
899
        return "V$cardnumber$rem";
899
        return "V$cardnumber$rem";
900
     } else {
900
     } else {
901
901
902
     # MODIFIED BY JF: mysql4.1 allows casting as an integer, which is probably
903
     # better. I'll leave the original in in case it needs to be changed for you
904
     # my $sth=$dbh->prepare("select max(borrowers.cardnumber) from borrowers");
905
        my $sth = $dbh->prepare(
902
        my $sth = $dbh->prepare(
906
            "select max(cast(cardnumber as signed)) from borrowers"
903
            'SELECT MAX( CAST( cardnumber AS SIGNED ) ) FROM borrowers WHERE cardnumber REGEXP "^-?[0-9]+$"'
907
        );
904
        );
908
        $sth->execute;
905
        $sth->execute;
909
        my ($result) = $sth->fetchrow;
906
        my ($result) = $sth->fetchrow;
910
- 

Return to bug 8533