admin管理员组

文章数量:1125482

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 11 months ago.

Improve this question

I am running into a collation problem when using a function.

My query is this

SELECT CONCAT(PERSON.LastName,', ',PERSON.FirstName) AS 'PersonName', 
funcGetStandardValue(PERSON.ProgrammeId) AS Programme 
FROM wp_persons AS PERSON WHERE (funcGetStandardValue(PERSON.ProgrammeId) = 'Programme1' )

The function is this

BEGIN
    DECLARE theTitle VARCHAR(100);
    SELECT Title INTO theTitle FROM wp_standard_values WHERE SvId = Id;
    RETURN theTitle;
END

Both tables (and all varchar columns) concerned (wp_persons and wp_standard_values) have the same collation of utf8mb4_general_ci

The error returned is

Illegal mix of collations (utf8mb4_unicode_ci,COERCIBLE) and (utf8mb4_unicode_520_ci,COERCIBLE) for operation '='

The error does not occur if I run the sql script in phpmyadmin

本文标签: wpdbIllegal mix of collations using a function