Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
44 | public function loadData( |
||
45 | string $table, |
||
46 | string $filename, |
||
47 | array $fields, |
||
48 | string $mode |
||
49 | ): string { |
||
50 | $sql ="LOAD DATA LOCAL INFILE '{$filename}' |
||
51 | REPLACE INTO TABLE {$table} |
||
52 | FIELDS TERMINATED BY '|' ENCLOSED BY '\"' LINES TERMINATED BY '" . PHP_EOL . "' |
||
53 | (`" . implode("`, `", $fields) . "`)"; |
||
54 | // Run the query if asked |
||
55 | if ($this->pretend === false) { |
||
56 | $this->conn->query($sql); |
||
57 | } |
||
58 | |||
59 | return $sql; |
||
60 | } |
||
61 | } |
||
62 |