0

I'm trying to import a XML-feed to my database. The first 8 records are inserted correctly, but then I get this error:

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '=' 

It's with the following SELECT-query:

        $stmt = $this->dbc->prepare(
            "
                SELECT
                            c.category_id       AS category_id
                FROM 
                            categories c
                WHERE
                            c.parent_category_id = :parentCategoryId
                    AND
                            c.name = :name
            "
        );

Anyone has an idea to fix this? Via PHP or should I alter the database? I really have no idea, and I already checked the following questions/answers:

Thanks in advance!

Sam Leurs
  • 480
  • 4
  • 20
  • Hi, yesterday. What do you mean by _already checked the following questions/answers_? Have you APPLIED the accepted answer from the second link that you provided? –  Jan 13 '18 at 18:52
  • Hi, yes I tried but it does not work. – Sam Leurs Jan 13 '18 at 18:57

0 Answers0