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

(-)a/C4/Installer.pm (-2 / +1 lines)
Lines 487-493 sub load_sql { Link Here
487
                    my $table_name   = ( keys %$table )[0];                          # table name
487
                    my $table_name   = ( keys %$table )[0];                          # table name
488
                    my @rows         = @{ $table->{$table_name}->{rows} };           #
488
                    my @rows         = @{ $table->{$table_name}->{rows} };           #
489
                    my @columns      = ( sort keys %{$rows[0]} );                    # column names
489
                    my @columns      = ( sort keys %{$rows[0]} );                    # column names
490
                    my $fields       = join ",", @columns;                           # idem, joined
490
                    my $fields       = join ",", map{sprintf("`%s`", $_)} @columns;  # idem, joined
491
                    my $placeholders = join ",", map { "?" } @columns;               # '?,..,?' string
491
                    my $placeholders = join ",", map { "?" } @columns;               # '?,..,?' string
492
                    my $query        = "INSERT INTO $table_name ( $fields ) VALUES ( $placeholders )";
492
                    my $query        = "INSERT INTO $table_name ( $fields ) VALUES ( $placeholders )";
493
                    my $sth          = $dbh->prepare($query);
493
                    my $sth          = $dbh->prepare($query);
494
- 

Return to bug 13897