summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-04-01 19:46:41 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-04-01 19:46:41 +0200
commited89a07e3890f135f14cbe39aaf15a4c91f2c387 (patch)
treed1b488b64b8c45a04c147114e8103cf6e4ee8697
parent947d5fcee30a9a8102cda4cc41da54994efb641e (diff)
downloadgigologadmin-ed89a07e3890f135f14cbe39aaf15a4c91f2c387.tar.gz
gigologadmin-ed89a07e3890f135f14cbe39aaf15a4c91f2c387.tar.bz2
gigologadmin-ed89a07e3890f135f14cbe39aaf15a4c91f2c387.zip
Add some error reporting to Concert class.
-rw-r--r--includes/concert.php8
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);
}
}