Fix “No Event Found” With SQL Query

If you have an issue “No Event Found” and doing this article: https://webnus.net/dox/modern-events-calendar/no-event-found-issue-in-modern-event-calendar/  as well, you can fix it regarding to your database connection.

We strongly advise you get a backup of your database first.

If none of the above methods helped, we need to write a query which can work with the charsets of your website.

CREATE TABLE IF NOT EXISTS #__mec_dates (  id int(10) UNSIGNED NOT NULL,  post_id int(10) NOT NULL,  dstart date NOT NULL,  dend date NOT NULL,  tstart int(11) UNSIGNED NOT NULL DEFAULT '0',  tend int(11) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=[:CHARSET:] COLLATE=[:COLLATE:];
ALTER TABLE #__mec_dates ADD PRIMARY KEY (id), ADD KEY post_id (post_id), ADD KEY tstart (tstart), ADD KEY tend (tend);
ALTER TABLE #__mec_dates MO

The substitution for charsets should be done as follows:

[:CHARSET:] => utf8mb4 or utf8
[:COLLATE:] => utf8mb4_unicode_ci or utf8_general_ci
#__ => Table prefix. Normally wp_

In the end, the code will be something like this:

CREATE TABLE IF NOT EXISTS wp_mec_dates (  id int(10) UNSIGNED NOT NULL,  post_id int(10) NOT NULL,  dstart date NOT NULL,  dend date NOT NULL,  tstart int(11) UNSIGNED NOT NULL DEFAULT '0',  tend int(11) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE wp_mec_dates ADD PRIMARY KEY (id), ADD KEY post_id (post_id), ADD KEY tstart (tstart), ADD KEY tend (tend);
ALTER TABLE wp_mec_dates MODIFY id int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

This query should then be placed on the table of dates of MEC.

Then you need to update the events and shortcodes one by one in the back-end.

Note 1: Before starting to do this, only to make sure nothing goes wrong, know that you can reinstall MEC and its Add-Ons.

Note 2: Please do not forget to backup first.

Note 3: If you need our help, please send your request on this link

Recommended Posts

0 Comments

No Comment.