From fecf35ae3e6defb48b84e924b3389ce8ee8bb38d Mon Sep 17 00:00:00 2001 From: zero Date: Wed, 4 Apr 2007 10:06:13 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@961 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/db/DBSqlite3.class.php | 36 +++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/classes/db/DBSqlite3.class.php b/classes/db/DBSqlite3.class.php index 17f30e1f0..1a8b54b5e 100644 --- a/classes/db/DBSqlite3.class.php +++ b/classes/db/DBSqlite3.class.php @@ -197,15 +197,23 @@ $default = $column->attrs->default; $auto_increment = $column->attrs->auto_increment; - $column_schema[] = sprintf('%s %s%s %s %s %s %s', - $name, - $this->column_type[$type], - $size?'('.$size.')':'', - $notnull?'NOT NULL':'', - $primary_key?'PRIMARY KEY':'', - $default?"DEFAULT '".$default."'":'', - $auto_increment?'AUTOINCREMENT':'' - ); + if($auto_increment) { + $column_schema[] = sprintf('%s %s%s', + $name, + $this->column_type[$type], + $auto_increment?'AUTOINCREMENT':'' + ); + } else { + $column_schema[] = sprintf('%s %s%s %s %s %s %s', + $name, + $this->column_type[$type], + $size?'('.$size.')':'', + $notnull?'NOT NULL':'', + $primary_key?'PRIMARY KEY':'', + $default?"DEFAULT '".$default."'":'', + $auto_increment?'AUTOINCREMENT':'' + ); + } if($unique) $unique_list[$unique][] = $name; else if($index) $index_list[$index][] = $name; @@ -407,8 +415,14 @@ } $virtual_no = $total_count - ($page-1)*$navigation->list_count; - while($tmp = $this->_fetch($result)) { - $data[$virtual_no--] = $tmp; + $tmp_data = $this->_fetch($result); + if($tmp_data) { + if(!is_array($tmp_data)) $tmp_data = array($tmp_data); + foreach($tmp_data as $tmp) { + $data[$virtual_no--] = $tmp; + } + } else { + $data = null; } $buff = new Object();