Posted: January 24, 2019 at 7:38 am
|
I have to find attendees in the database table ‘Attendee_meta’ using EE4. I am writing their first and last name using the searcher in page ‘espresso_registrations’. It works, but the searcher only return any result if I write the first name and last name with exactly their lowercase and uppercase. If I write, for example, “Pablo Gómez”, I won’t have any result unless in the database ‘ATT_fname’ was “Pablo” and ‘ATT_lname’ was “Gómez”. I mean, if in the database I have “pablo” in ‘ATT_fname’ and “gómez” in ‘ATT_lname’, I won’t have any result. I need to make case insensitive searches by tipping the attendees first name and last name together, can you please tell me if is it posible, or how can I do it? |
Hi there, The search should already be case insensitive, for example: https://monosnap.com/file/b4LKFg0x8BwV1sDNgEWRENjJHsxHi6 and – https://monosnap.com/file/5P881tTJZSc7JLuVPYFetHcNnMOTkZ However it depends on the collation of the tables in your database, mine are |
|
|
Hi, thanks for reply so fast! My database tables was set as ‘utf8general_ci’, but i’ve just changed to ‘utf8mb4_unicode_ci’ and it’s still not working. There you have a capture of the database tables collation: Also, it is a capture of the problem: |
Why did you change them? The
That’s not the collation for the DB tables, that’s for the individual columns but either way, both of those should have worked. What collation does your |
|
|
My _posts table use ‘utf8_bin’ |
What version of WordPress are you running? |
|
|
I am using WP 4.9.9 |
You’re currently using WordPress 4.9.9, correct? In WP 4.2 the tables were updated to use It could be your server doesn’t meet the requirements, or you may have specific collations defined within your wp-config.php file and thats the easiest to check, so take a look in yours and check for something like:
|
|
|
I have found should I define DB_COLLATE as ‘utf8mb4_unicode_ci’ in the php file? |
No, that’s the default and is fine. It’s when another collation is set that prevents the update. So, in that case, it could be one of these conditions are not met:
https://make.wordpress.org/core/2015/04/02/the-utf8mb4-upgrade/ |
|
|
I’ve checked that those conditions are met could it be for another reason? |
Not that I know of and it’s a WordPress core function so I have no idea why those tables haven’t been converted. Actually, its possible your server didn’t meet the requirements when 4.2 and 4.3 were released, the update doesn’t happen after that but you can force it: https://florianbrinkmann.com/en/3457/switch-wordpress-from-utf8-to-utf8mb4-retrospectively/ Note, I highly recommend you backup your database before moving forward, if anything goes wrong with the above you’ll need that backup. |
|
|
It has worked, thank you very much! |
The support post ‘Find attendees by their first and last name in registrations (case insensitive)’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.