From 38e407c653047a63791bbc4bc9e46da91a05fe5d Mon Sep 17 00:00:00 2001 From: ozhozh Date: Thu, 11 Mar 2010 19:45:00 +0000 Subject: [PATCH] Log table inconsistency between upgrader/installer. Fixes issue 267. git-svn-id: http://yourls.googlecode.com/svn/trunk@299 12232710-3e20-11de-b438-597f59cd7555 --- includes/functions-install.php | 2 +- yourls-infos.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/functions-install.php b/includes/functions-install.php index c916fdc..ecd5a2c 100644 --- a/includes/functions-install.php +++ b/includes/functions-install.php @@ -152,7 +152,7 @@ function yourls_create_sql_tables() { 'CREATE TABLE IF NOT EXISTS `'.YOURLS_DB_TABLE_LOG.'` ('. '`click_id` int(11) NOT NULL auto_increment,'. '`click_time` datetime NOT NULL,'. - '`keyword` varchar(200) BINARY NOT NULL,'. + '`shorturl` varchar(200) BINARY NOT NULL,'. '`referrer` varchar(200) NOT NULL,'. '`user_agent` varchar(255) NOT NULL,'. '`ip_address` varchar(41) NOT NULL,'. diff --git a/yourls-infos.php b/yourls-infos.php index 1a2e114..42c3e26 100644 --- a/yourls-infos.php +++ b/yourls-infos.php @@ -33,10 +33,10 @@ if( $aggregate ) { $keywords = join( "', '", $keyword_list ); // Fetch information for all keywords pointing to $longurl - $hits = $ydb->get_results( "SELECT `keyword`, `click_time`, `referrer`, `user_agent`, `country_code` FROM `$table` WHERE `keyword` IN ( '$keywords' );" ); + $hits = $ydb->get_results( "SELECT `shorturl`, `click_time`, `referrer`, `user_agent`, `country_code` FROM `$table` WHERE `shorturl` IN ( '$keywords' );" ); } else { // Fetch information for current keyword only - $hits = $ydb->get_results( "SELECT `click_time`, `referrer`, `user_agent`, `country_code` FROM `$table` WHERE `keyword` = '$keyword';" ); + $hits = $ydb->get_results( "SELECT `click_time`, `referrer`, `user_agent`, `country_code` FROM `$table` WHERE `shorturl` = '$keyword';" ); } $referrers = array(); -- 2.45.0