Exception: FLEA_Db_Exception_SqlQuery
Message: SQL Error Message: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1"
SQL : "SELECT COUNT(`news`.`id`) FROM `news` WHERE pid="
SQL Error code: "7335941".
Filename: /www/wwwroot/qufumarathon.com/FLEA/FLEA/Db/Driver/Abstract.php [562]
#8 FLEA_Db_Driver_Mysql::execute('SELECT COUNT(`news`.`id`) F ...')
ARGS:
Array
(
[0] => SELECT COUNT(`news`.`id`) FROM `news` WHERE pid=
)
SOURCE CODE:
552 |
|
553 |
/**
|
554 |
* 执行查询,返回第一条记录的第一个字段
|
555 |
*
|
556 |
* @param string|resource $sql
|
557 |
*
|
558 |
* @return mixed
|
559 |
*/
|
560 |
function getOne($sql)
|
561 |
{
|
562 |
$res = is_resource($sql) ? $sql : $this->execute($sql);
|
563 |
$row = $this->fetchRow($res);
|
564 |
$this->freeRes($res);
|
565 |
return isset($row[0]) ? $row[0] : null;
|
566 |
}
|
567 |
|
568 |
/**
|
569 |
* 执行查询,返回第一条记录
|
570 |
*
|
571 |
* @param string|resource $sql
|
572 |
*
|
Filename: /www/wwwroot/qufumarathon.com/FLEA/FLEA/Db/TableDataGateway.php [731]
#7 FLEA_Db_Driver_Abstract::getOne('SELECT COUNT(`news`.`id`) F ...')
ARGS:
Array
(
[0] => SELECT COUNT(`news`.`id`) FROM `news` WHERE pid=
)
SOURCE CODE:
721 |
*/
|
722 |
function findCount($conditions = null, $fields = null)
|
723 |
{
|
724 |
list($whereby, $distinct) = $this->getWhere($conditions);
|
725 |
if (is_null($fields)) {
|
726 |
$fields = $this->qpk;
|
727 |
} else {
|
728 |
$fields = $this->dbo->qfields($fields, $this->fullTableName);
|
729 |
}
|
730 |
$sql = "SELECT {$distinct}COUNT({$fields}) FROM {$this->qtableName}{$whereby}";
|
731 |
return (int)$this->dbo->getOne($sql);
|
732 |
}
|
733 |
|
734 |
/**
|
735 |
* 保存数据到数据库
|
736 |
*
|
737 |
* 如果数据包含主键值,则 save() 会调用 update() 来更新记录,否则调用 create() 来创建记录。
|
738 |
*
|
739 |
* @param array $row
|
740 |
* @param boolean $saveLinks
|
741 |
* @param boolean $updateCounter
|
Filename: /www/wwwroot/qufumarathon.com/FLEA/FLEA/Helper/Pager.php [208]
#6 FLEA_Db_TableDataGateway::findCount('pid=')
ARGS:
Array
(
[0] => pid=
)
SOURCE CODE:
198 |
function FLEA_Helper_Pager(& $source, $currentPage, $pageSize = 20, $conditions = null, $sortby = null, $basePageIndex = 0)
|
199 |
{
|
200 |
$this->_basePageIndex = $basePageIndex;
|
201 |
$this->_currentPage = $this->currentPage = $currentPage;
|
202 |
$this->pageSize = $pageSize;
|
203 |
|
204 |
if (is_object($source)) {
|
205 |
$this->source =& $source;
|
206 |
$this->_conditions = $conditions;
|
207 |
$this->_sortby = $sortby;
|
208 |
$this->totalCount = $this->count = (int)$this->source->findCount($conditions);
|
209 |
$this->computingPage();
|
210 |
} elseif (!empty($source)) {
|
211 |
$this->source = $source;
|
212 |
$sql = "SELECT COUNT(*) FROM ( $source ) as _count_table";
|
213 |
$this->dbo =& FLEA::getDBO();
|
214 |
$this->totalCount = $this->count = (int)$this->dbo->getOne($sql);
|
215 |
$this->computingPage();
|
216 |
}
|
217 |
}
|
218 |
|
Filename: /www/wwwroot/qufumarathon.com/APP/Controller/Default.php [1833]
#5 FLEA_Helper_Pager::FLEA_Helper_Pager(Model_News, '5', 12, 'pid=', 'ctime desc')
ARGS:
Array
(
[0] => Model_News Object
(
[tableName] => news
[primaryKey] => id
[belongsTo] => Array
(
[0] => Array
(
[tableClass] => Model_Bisai
[mappingName] => pinfo
[foreignKey] => pid
[enabled] => 1
)
)
[schema] =>
[fullTableName] => news
[hasOne] =>
[hasMany] =>
[manyToMany] =>
[meta] => Array
(
[ID] => Array
(
[name] => id
[scale] =>
[type] => int
[maxLength] => 11
[simpleType] => R
[notNull] => 1
[primaryKey] => 1
[autoIncrement] => 1
[binary] =>
[unsigned] =>
[hasDefault] =>
[description] =>
)
[TITLE] => Array
(
[name] => title
[scale] =>
[type] => text
[maxLength] => -1
[simpleType] => X
[notNull] =>
[primaryKey] =>
[autoIncrement] =>
[binary] =>
[unsigned] =>
[hasDefault] =>
[description] =>
)
[CONTENT] => Array
(
[name] => content
[scale] =>
[type] => longtext
[maxLength] => -1
[simpleType] => X
[notNull] =>
[primaryKey] =>
[autoIncrement] =>
[binary] =>
[unsigned] =>
[hasDefault] =>
[description] =>
)
[CTIME] => Array
(
[name] => ctime
[scale] =>
[type] => date
[maxLength] => -1
[simpleType] => D
[notNull] =>
[primaryKey] =>
[autoIncrement] =>
[binary] =>
[unsigned] =>
[hasDefault] =>
[description] =>
)
[PID] => Array
(
[name] => pid
[scale] =>
[type] => int
[maxLength] => 11
[simpleType] => I
[notNull] => 1
[primaryKey] =>
[autoIncrement] =>
[binary] =>
[unsigned] =>
[hasDefault] =>
[description] =>
)
)
[fields] => Array
(
[0] => ID
[1] => TITLE
[2] => CONTENT
[3] => CTIME
[4] => PID
)
[autoValidating] =>
[verifier] =>
[validateRules] =>
[createdTimeFields] => Array
(
[0] => CREATED
[1] => CREATED_ON
[2] => CREATED_AT
)
[updatedTimeFields] => Array
(
[0] => UPDATED
[1] => UPDATED_ON
[2] => UPDATED_AT
)
[autoLink] => 1
[dbo] => FLEA_Db_Driver_Mysql Object
(
[NEXT_ID_SQL] => UPDATE %s SET id = LAST_INSERT_ID(id + 1)
[CREATE_SEQ_SQL] => CREATE TABLE %s (id INT NOT NULL)
[INIT_SEQ_SQL] => INSERT INTO %s VALUES (%s)
[DROP_SEQ_SQL] => DROP TABLE %s
[META_COLUMNS_SQL] => SHOW FULL COLUMNS FROM %s
[PARAM_STYLE] => ?
[HAS_INSERT_ID] => 1
[HAS_AFFECTED_ROWS] => 1
[_mysqlVersion] => 5.5.62-log
[TRUE_VALUE] => 1
[FALSE_VALUE] => 0
[NULL_VALUE] => NULL
[HAS_TRANSACTION] =>
[HAS_SAVEPOINT] =>
[RESULT_FIELD_NAME_LOWER] =>
[dsn] => Array
(
[driver] => mysql
[host] => 127.0.0.1
[login] => mlsnew
[password] => RxwhFHwWEAeid68K
[database] => mlsnew
[port] =>
[options] =>
[prefix] =>
[schema] =>
[id] => mysql://mlsnew:RxwhFHwWEAeid68K@127.0.0.1_/mlsnew//
)
[conn] => Resource id #44
[log] => Array
(
)
[querycount] => 26
[lasterr] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
[lasterrcode] => 1064
[_insertId] =>
[_transCount] => 0
[_hasFailedQuery] =>
[_savepointStack] => Array
(
)
[enableLog] =>
)
[links] => Array
(
[PINFO] => FLEA_Db_BelongsToLink Object
(
[oneToOne] => 1
[name] => pinfo
[tableClass] => Model_Bisai
[foreignKey] => pid
[mappingName] => pinfo
[type] => 2
[sort] =>
[conditions] =>
[fields] => *
[limit] =>
[enabled] => 1
[countOnly] =>
[counterCache] =>
[linkRead] => 1
[linkCreate] =>
[linkUpdate] =>
[linkRemove] =>
[linkRemoveFillValue] => 0
[saveAssocMethod] => save
[mainTDG] => Model_News Object
*RECURSION*
[assocTDG] =>
[_req] => Array
(
[0] => name
[1] => tableClass
[2] => mappingName
)
[_optional] => Array
(
[0] => foreignKey
[1] => sort
[2] => conditions
[3] => fields
[4] => limit
[5] => enabled
[6] => countOnly
[7] => counterCache
[8] => linkRead
[9] => linkCreate
[10] => linkUpdate
[11] => linkRemove
[12] => linkRemoveFillValue
[13] => saveAssocMethod
)
[qforeignKey] =>
[dbo] => FLEA_Db_Driver_Mysql Object
(
[NEXT_ID_SQL] => UPDATE %s SET id = LAST_INSERT_ID(id + 1)
[CREATE_SEQ_SQL] => CREATE TABLE %s (id INT NOT NULL)
[INIT_SEQ_SQL] => INSERT INTO %s VALUES (%s)
[DROP_SEQ_SQL] => DROP TABLE %s
[META_COLUMNS_SQL] => SHOW FULL COLUMNS FROM %s
[PARAM_STYLE] => ?
[HAS_INSERT_ID] => 1
[HAS_AFFECTED_ROWS] => 1
[_mysqlVersion] => 5.5.62-log
[TRUE_VALUE] => 1
[FALSE_VALUE] => 0
[NULL_VALUE] => NULL
[HAS_TRANSACTION] =>
[HAS_SAVEPOINT] =>
[RESULT_FIELD_NAME_LOWER] =>
[dsn] => Array
(
[driver] => mysql
[host] => 127.0.0.1
[login] => mlsnew
[password] => RxwhFHwWEAeid68K
[database] => mlsnew
[port] =>
[options] =>
[prefix] =>
[schema] =>
[id] => mysql://mlsnew:RxwhFHwWEAeid68K@127.0.0.1_/mlsnew//
)
[conn] => Resource id #44
[log] => Array
(
)
[querycount] => 26
[lasterr] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
[lasterrcode] => 1064
[_insertId] =>
[_transCount] => 0
[_hasFailedQuery] =>
[_savepointStack] => Array
(
)
[enableLog] =>
)
[assocTDGObjectId] =>
[init] =>
)
)
[qtableName] => `news`
[qpk] => `news`.`id`
[pka] => flea_pkref_id
[qpka] => `news`.`id` AS flea_pkref_id
[lastValidationResult] =>
)
[1] => 5
[2] => 12
[3] => pid=
[4] => ctime desc
)
SOURCE CODE:
1823 |
|
1824 |
$this->tpl->display('App/huoban.html');
|
1825 |
}
|
1826 |
|
1827 |
#列表
|
1828 |
function actionNews()
|
1829 |
{
|
1830 |
$page = isset($_GET['page'])?$_GET['page']:0;
|
1831 |
$pageSize = 12;
|
1832 |
FLEA::loadHelper('Pager');
|
1833 |
$pager = & new FLEA_Helper_Pager($this->News,$page,$pageSize,"pid=".$_GET['matchid'],'ctime desc');
|
1834 |
$result = $pager->findAll();
|
1835 |
$this->tpl->assign('pagerData',$pager->getPagerData());
|
1836 |
$this->tpl->assign('totalCount', $pager->totalCount);
|
1837 |
$this->tpl->assign('res', $result);
|
1838 |
$this->tpl->assign('page', $page);
|
1839 |
$this->tpl->display('App/news.html');
|
1840 |
}
|
1841 |
|
1842 |
function actionNew()
|
1843 |
{
|
Filename: /www/wwwroot/qufumarathon.com/FLEA/FLEA/Dispatcher/Simple.php [120]
#4 Controller_Default::actionNews()
ARGS:
Array
(
)
SOURCE CODE:
110 |
}
|
111 |
if (method_exists($controller, '__setDispatcher')) {
|
112 |
$controller->__setDispatcher($this);
|
113 |
}
|
114 |
|
115 |
// 调用 _beforeExecute() 方法
|
116 |
if (method_exists($controller, '_beforeExecute')) {
|
117 |
$controller->_beforeExecute($actionMethod);
|
118 |
}
|
119 |
// 执行 action 方法
|
120 |
$ret = $controller->{$actionMethod}();
|
121 |
// 调用 _afterExecute() 方法
|
122 |
if (method_exists($controller, '_afterExecute')) {
|
123 |
$controller->_afterExecute($actionMethod);
|
124 |
}
|
125 |
return $ret;
|
126 |
} while (false);
|
127 |
|
128 |
if ($callback) {
|
129 |
// 检查是否调用应用程序设置的错误处理程序
|
130 |
$args = array($controllerName, $actionName, $controllerClass);
|
Filename: /www/wwwroot/qufumarathon.com/FLEA/FLEA/Dispatcher/Simple.php [77]
#3 FLEA_Dispatcher_Simple::_executeAction('Default', 'News', 'Controller_Default')
ARGS:
Array
(
[0] => Default
[1] => News
[2] => Controller_Default
)
SOURCE CODE:
67 |
|
68 |
/**
|
69 |
* 从请求中分析 Controller、Action 和 Package 名字,然后执行指定的 Action 方法
|
70 |
*
|
71 |
* @return mixed
|
72 |
*/
|
73 |
function dispatching()
|
74 |
{
|
75 |
$controllerName = $this->getControllerName();
|
76 |
$actionName = $this->getActionName();
|
77 |
return $this->_executeAction($controllerName, $actionName, $this->getControllerClass($controllerName));
|
78 |
}
|
79 |
|
80 |
/**
|
81 |
* 执行指定的 Action 方法
|
82 |
*
|
83 |
* @param string $controllerName
|
84 |
* @param string $actionName
|
85 |
* @param string $controllerClass
|
86 |
*
|
87 |
* @return mixed
|
Filename: /www/wwwroot/qufumarathon.com/FLEA/FLEA.php [816]
#2 FLEA_Dispatcher_Simple::dispatching()
ARGS:
Array
(
)
SOURCE CODE:
806 |
require_once($MVCPackageFilename);
|
807 |
}
|
808 |
FLEA::init();
|
809 |
|
810 |
// 载入调度器并转发请求到控制器
|
811 |
$dispatcherClass = FLEA::getAppInf('dispatcher');
|
812 |
FLEA::loadClass($dispatcherClass);
|
813 |
|
814 |
$dispatcher =& new $dispatcherClass($_GET);
|
815 |
FLEA::register($dispatcher, $dispatcherClass);
|
816 |
$dispatcher->dispatching();
|
817 |
}
|
818 |
|
819 |
/**
|
820 |
* 准备运行环境
|
821 |
*
|
822 |
* @param boolean $loadMVC
|
823 |
*/
|
824 |
function init($loadMVC = false)
|
825 |
{
|
826 |
static $firstTime = true;
|
Filename: /www/wwwroot/qufumarathon.com/index.php [24]
#1 FLEA::runMVC()
ARGS:
Array
(
)
SOURCE CODE:
14 |
'languages' => array('中文簡體'=>'cn','繁體'=>'tw'),
|
15 |
'defaultLanguage' => $_SESSION['lang']?$_SESSION['lang']:'cn',
|
16 |
'languageFilesDir' => $dirname."/LANGUAGE",
|
17 |
);
|
18 |
$dataConfigFilename = $dirname.'/CONFIG/DSN.php';
|
19 |
FLEA::loadAppInf($dataConfigFilename);
|
20 |
FLEA::loadAppInf($appInf);
|
21 |
FLEA::import(APP_DIR);
|
22 |
|
23 |
|
24 |
FLEA::runMVC();
|
25 |
?> |