summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/concert.php2
-rw-r--r--includes/venue.php10
2 files changed, 10 insertions, 2 deletions
diff --git a/includes/concert.php b/includes/concert.php
index aff41ac..d95934e 100644
--- a/includes/concert.php
+++ b/includes/concert.php
@@ -147,7 +147,7 @@ if ( !class_exists('GiglogAdmin_Concert') ) {
global $wpdb;
$sql = 'SELECT id from wpg_concerts'
- . ' where wpgconcert_name = "' . $cname .'"'
+ . ' where upper(wpgconcert_name) = upper("' . $cname .'")'
. ' and venue = ' . $venue
. ' and wpgconcert_date ="' . $date . '"';
diff --git a/includes/venue.php b/includes/venue.php
index 07dec0e..f6f46b2 100644
--- a/includes/venue.php
+++ b/includes/venue.php
@@ -35,6 +35,10 @@ if ( !class_exists('GiglogAdmin_Venue') ) {
'wpgvenue_city' => $city,
]);
$venue->save();
+ error_log( 'NEW VENUE ADDED: '
+ . ' ID: ' . $venue -> id()
+ . ' VENUE NAME ' . $name
+ . ', VENUE CITY ' . $city);
return $venue;
}
@@ -42,10 +46,14 @@ if ( !class_exists('GiglogAdmin_Venue') ) {
static function find_or_create($name, $city = 'Oslo')
{
global $wpdb;
- $venuesql = 'SELECT * FROM wpg_venues WHERE upper(wpgvenue_name)="' . $name . '"';
+ $venuesql = 'SELECT * FROM wpg_venues WHERE upper(wpgvenue_name)=upper("' . $name . '")'.' and wpgvenue_city="'.$city.'"';
$results = $wpdb->get_results($venuesql);
if ($results) {
+ error_log( 'DUPLICATE VENUE: '
+ . ' ID: ' . $results[0]->id
+ . ' VENUE NAME ' . $name
+ . ', VENUE CITY ' . $city);
return new GiglogAdmin_Venue($results[0]);
}
else {