diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-04-01 19:46:41 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-04-01 19:46:41 +0200 |
commit | ed89a07e3890f135f14cbe39aaf15a4c91f2c387 (patch) | |
tree | d1b488b64b8c45a04c147114e8103cf6e4ee8697 | |
parent | 947d5fcee30a9a8102cda4cc41da54994efb641e (diff) | |
download | gigologadmin-ed89a07e3890f135f14cbe39aaf15a4c91f2c387.tar.gz gigologadmin-ed89a07e3890f135f14cbe39aaf15a4c91f2c387.tar.bz2 gigologadmin-ed89a07e3890f135f14cbe39aaf15a4c91f2c387.zip |
Add some error reporting to Concert class.
-rw-r--r-- | includes/concert.php | 8 |
1 files changed, 7 insertions, 1 deletions
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); } } |