From ed89a07e3890f135f14cbe39aaf15a4c91f2c387 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 1 Apr 2021 19:46:41 +0200 Subject: Add some error reporting to Concert class. --- includes/concert.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/concert.php b/includes/concert.php index 59f78c2..7672c96 100644 --- a/includes/concert.php +++ b/includes/concert.php @@ -23,7 +23,7 @@ if ( !class_exists('GiglogAdmin_Concert') ) { { global $wpdb; - $wpdb->insert('wpg_concerts', array( + $res = $wpdb->insert('wpg_concerts', array( 'band' => $band, 'venue' => $venue, 'wpgconcert_date' => $date, @@ -31,6 +31,11 @@ if ( !class_exists('GiglogAdmin_Concert') ) { 'wpgconcert_event' => $eventlink )); + if ( !$res ) { + error_log( __CLASS__ . '::' . __FUNCTION__ . ": {$wpdb->last_error}"); + die; + } + return $wpdb->insert_id; } @@ -43,6 +48,7 @@ if ( !class_exists('GiglogAdmin_Concert') ) { . ' and venue = ' . $venue . ' and wpgconcert_date ="' . $date . '"'; + error_log(__CLASS__ . '::' . __FUNCTION__ . ": {$sql}"); return $wpdb->get_results($sql); } } -- cgit v1.2.3