I have a page that lets you import CVS to Mysql database, but when in the CVS there is a symbol that occupies 4 bits instead of 3, I get this error:
SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\x96 0014...'
And the import of the rows that contain some symbol as bar -
, slash /
or other, is suspended.
How do I solve it in order to import everything? From collation I have utf8_general_ci
, I use PDO prepared statements to make INSERT
. My code:
$sql = "
INSERT INTO 'lithuania_customers_2016'
('customer_db_id', 'user_id', 'user_email')
VALUES (?, ?, ?);";
$stmt = $pdo->prepare($sql);
$stmt->execute(array(
$emapData[0],
$emapData[1],
$emapData[2]
));