Title: rileywebdev's Replies | WordPress.org

---

# rileywebdev

  [  ](https://wordpress.org/support/users/rileywebdev/)

 *   [Profile](https://wordpress.org/support/users/rileywebdev/)
 *   [Topics Started](https://wordpress.org/support/users/rileywebdev/topics/)
 *   [Replies Created](https://wordpress.org/support/users/rileywebdev/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/rileywebdev/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/rileywebdev/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/rileywebdev/engagements/)
 *   [Favorites](https://wordpress.org/support/users/rileywebdev/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] PHP Error: WordPress database error Incorrect DATETIME value: ” for query](https://wordpress.org/support/topic/php-error-wordpress-database-error-incorrect-datetime-value-for-query/)
 *  Thread Starter [rileywebdev](https://wordpress.org/support/users/rileywebdev/)
 * (@rileywebdev)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/php-error-wordpress-database-error-incorrect-datetime-value-for-query/#post-16904003)
 * Hi Darian,
 * I’ve found out that removing the event header and footer in single-event.php 
   prevents the error from popping up. Essentially, getting rid of **tribe_the_prev_event_link**
   and **tribe_the_next_event_link **solves the problem. This is the code I removed:
 * Header:
 *     ```wp-block-code
       	<!-- Event header -->
       	<div id="tribe-events-header" <?php tribe_events_the_header_attributes() ?>>
       		<!-- Navigation -->
       		<nav class="tribe-events-nav-pagination" aria-label="<?php printf( esc_html__( '%s Navigation', 'the-events-calendar' ), $events_label_singular ); ?>">
       			<ul class="tribe-events-sub-nav">
       				<li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '<span>&laquo;</span> %title%' ) ?></li>
       				<li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% <span>&raquo;</span>' ) ?></li>
       			</ul>
       			<!-- .tribe-events-sub-nav -->
       		</nav>
       	</div>
       	<!-- #tribe-events-header -->
       ```
   
 * Footer:
 *     ```wp-block-code
       	<!-- Event footer -->
       	<div id="tribe-events-footer">
       		<!-- Navigation -->
       		<nav class="tribe-events-nav-pagination" aria-label="<?php printf( esc_html__( '%s Navigation', 'the-events-calendar' ), $events_label_singular ); ?>">
       			<ul class="tribe-events-sub-nav">
       				<li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '<span>&laquo;</span> %title%' ) ?></li>
       				<li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% <span>&raquo;</span>' ) ?></li>
       			</ul>
       			<!-- .tribe-events-sub-nav -->
       		</nav>
       	</div>
       	<!-- #tribe-events-footer -->
       ```
   
 * I’m using PHP 8.1, MySQL 8.0.33, WordPress 6.2.2.
 * Viewing the events/venues on the frontend doesn’t trigger the error. Could this
   be related to a cron job? I can’t find any way to trigger the error, other than
   waiting for about a day — then it will pop up seemingly randomly. The error always
   comes in sets of two: one error mentions **tribe_the_prev_event_link**, and the
   other error mentions **tribe_the_next_event_link**. Sometimes just one set of
   errors shows up, sometimes its multiple sets, and sometimes more sets of errors
   pop up throughout the day.
 * I’m using a custom single-event.php template but I’ve set it to the default code
   for this course of testing.
 * I was able to prevent the error from popping up, but I want to keep the prev/
   next event buttons without it producing an error.
    -  This reply was modified 2 years, 11 months ago by [rileywebdev](https://wordpress.org/support/users/rileywebdev/).

Viewing 1 replies (of 1 total)