leomarquine / php-etl

Extract, Transform and Load data using PHP.
MIT License
178 stars 81 forks source link

Uncaught PDOException: SQLSTATE[HY093] / Quoted elcosure issue #20

Closed Naelpuissant closed 5 years ago

Naelpuissant commented 5 years ago

Hi, It seems that the makeColumns function doesn't work in my case, my first column keep his double quote even if I specify the enclosure option : this line (from Csv class / makColumns) $columns = array_flip(str_getcsv(fgets($handle), $this->delimiter, $this->enclosure)); return array(3) { [""FOO""]=> int(0) ["BAR"]=> int(1) ["FUZ"]=> int(2) } So it trigger a PDOException: SQLSTATE[HY093]

Naelpuissant commented 5 years ago

Okay my bad, my first line contain some weird invisible chars (UTF8-BOM) at the begining, so the str_getcsv fail to parse it. Sorry, I will close this issue :)