diff options
-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); } } |