From 6e7958d91fcb949ac27e3fc6d1b67833e013f725 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Sat, 29 Jun 2013 16:21:31 +0000
Subject: [PATCH] Poprawka pobierania wyników Multi Multi z 21:40

---
 class/BotSession.php |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/class/BotSession.php b/class/BotSession.php
index 25ec23c..36cd174 100644
--- a/class/BotSession.php
+++ b/class/BotSession.php
@@ -39,8 +39,8 @@
 			$this->PDO->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_TO_STRING);
 			
 			$st = $this->PDO->query('SELECT value FROM data WHERE class=\'\' AND name=\'_version\'');
-			if($st->rowCount > 0) {
-				$row = $st->fetch(PDO::FETCH_ASSOC);
+			$row = $st->fetch(PDO::FETCH_ASSOC);
+			if(is_array($row)) {
 				$version = (int)$row['value'];
 			}
 			else
@@ -55,10 +55,10 @@
 				$version = 1;
 			}
 			
-			if($version < 2) {
-				$this->PDO->query('DELETE FROM data WHERE class=NULL AND name=\'user_struct\'');
-				$this->PDO->query('INSERT OR REPLACE INTO data (class, name, value) VALUES (\'\', \'_version\', 2)');
-				$version = 2;
+			if($version < 3) {
+				$this->PDO->query('DELETE FROM data WHERE class IS NULL AND name=\'user_struct\'');
+				$this->PDO->query('INSERT OR REPLACE INTO data (class, name, value) VALUES (\'\', \'_version\', 3)');
+				$version = 3;
 			}
 			
 			return;

--
Gitblit v1.9.1