Exception: flea_db_exception_sqlquery
Message: SQL 错误消息: "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 'and tid!=81
ORDER BY created desc
LIMIT 3' at line 3"
SQL 语句: "SELECT `comments`.`tid` AS flea_pkref_tid, `comments`.*
FROM `comments`
WHERE authorid= and tid!=81
ORDER BY created desc
LIMIT 3"
SQL 错误代码: "7335941".
Filename: /var/www/html/hsj/home/FLEA/FLEA/Db/Driver/Mysql.php
#8
flea_db_exception_sqlquery::flea_db_exception_sqlquery('SELECT `comments`.`tid` AS ...', 'You have an error in your S ...', 1064)
FILE: Mysql.php
LINE: 230
ARGS:
Array
(
[0] => SELECT `comments`.`tid` AS flea_pkref_tid, `comments`.*
FROM `comments`
WHERE authorid= and tid!=81
ORDER BY created desc
LIMIT 3
[1] => 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 'and tid!=81
ORDER BY created desc
LIMIT 3' at line 3
[2] => 1064
)
SOURCE CODE:
| 220 |
if ($result !== false) {
|
| 221 |
$this->lasterr = null;
|
| 222 |
$this->lasterrcode = null;
|
| 223 |
return $result;
|
| 224 |
}
|
| 225 |
$this->lasterr = mysql_error($this->conn);
|
| 226 |
$this->lasterrcode = mysql_errno($this->conn);
|
| 227 |
if (!$throw) { return false; }
|
| 228 |
|
| 229 |
FLEA::loadClass('FLEA_Db_Exception_SqlQuery');
|
| 230 |
__THROW(new FLEA_Db_Exception_SqlQuery($sql, $this->lasterr, $this->lasterrcode));
|
| 231 |
return false;
|
| 232 |
}
|
| 233 |
|
| 234 |
/**
|
| 235 |
* 转义字符串
|
| 236 |
*
|
| 237 |
* @param string $value
|
| 238 |
*
|
| 239 |
* @return mixed
|
| 240 |
*/
|
Filename: /var/www/html/hsj/home/FLEA/FLEA/Db/Driver/Mysql.php
#7
flea_db_driver_mysql::execute('SELECT `comments`.`tid` AS ...')
FILE: Mysql.php
LINE: 459
ARGS:
Array
(
[0] => SELECT `comments`.`tid` AS flea_pkref_tid, `comments`.*
FROM `comments`
WHERE authorid= and tid!=81
ORDER BY created desc
LIMIT 3
)
SOURCE CODE:
| 449 |
if ($offset !== null) {
|
| 450 |
$sql .= "\nLIMIT " . (int)$offset;
|
| 451 |
if ($length !== null) {
|
| 452 |
$sql .= ', ' . (int)$length;
|
| 453 |
} else {
|
| 454 |
$sql .= ', 4294967294';
|
| 455 |
}
|
| 456 |
} elseif ($length !== null) {
|
| 457 |
$sql .= "\nLIMIT " . (int)$length;
|
| 458 |
}
|
| 459 |
return $this->execute($sql);
|
| 460 |
}
|
| 461 |
|
| 462 |
/**
|
| 463 |
* 执行一个查询,返回查询结果记录集
|
| 464 |
*
|
| 465 |
* @param string|resource $sql
|
| 466 |
*
|
| 467 |
* @return array
|
| 468 |
*/
|
| 469 |
function & getAll($sql)
|
Filename: /var/www/html/hsj/home/FLEA/FLEA/Db/TableDataGateway.php
#6
flea_db_driver_mysql::selectlimit('SELECT `comments`.`tid` AS ...', '3', )
FILE: TableDataGateway.php
LINE: 395
ARGS:
Array
(
[0] => SELECT `comments`.`tid` AS flea_pkref_tid, `comments`.*
FROM `comments`
WHERE authorid= and tid!=81
ORDER BY created desc
[1] => 3
[2] =>
)
SOURCE CODE:
| 385 |
$fields = $this->dbo->qfields($fields, $this->fullTableName);
|
| 386 |
if ($enableLinks) {
|
| 387 |
// 当有关联需要处理时,必须获得主表的主键字段值
|
| 388 |
$sql = "SELECT {$distinct}{$this->qpka}, {$fields}\nFROM {$this->qtableName}{$whereby}{$sortby}";
|
| 389 |
} else {
|
| 390 |
$sql = "SELECT {$distinct}{$fields}\nFROM {$this->qtableName}{$whereby}{$sortby}";
|
| 391 |
}
|
| 392 |
|
| 393 |
// 根据 $length 和 $offset 参数决定是否使用限定结果集的查询
|
| 394 |
if (null !== $length || null !== $offset) {
|
| 395 |
$result = $this->dbo->selectLimit($sql, $length, $offset);
|
| 396 |
} else {
|
| 397 |
$result = $this->dbo->execute($sql);
|
| 398 |
}
|
| 399 |
|
| 400 |
if ($enableLinks) {
|
| 401 |
/**
|
| 402 |
* 查询时同时将主键值单独提取出来,
|
| 403 |
* 并且准备一个以主键值为键名的二维数组用于关联数据的装配
|
| 404 |
*/
|
| 405 |
$pkvs = array();
|
Filename: /var/www/html/hsj/home/APP/Controller/Comment.php
#5
model_comments::findall('authorid= and tid!=81', 'created desc', '3')
FILE: Comment.php
LINE: 65
ARGS:
Array
(
[0] => authorid= and tid!=81
[1] => created desc
[2] => 3
)
SOURCE CODE:
| 55 |
|
| 56 |
$this->_modelComment->incrField($id,'views');
|
| 57 |
$comment1 = $this->_modelComment->find($id);
|
| 58 |
$views = $comment1['views'];
|
| 59 |
$reply = $comment1['replies'];
|
| 60 |
$authorid = $comment1['authorid'];
|
| 61 |
|
| 62 |
$comments = $this->_modelCommentReply->findall('tid='.$id,'created');
|
| 63 |
$this->_modelProductIndex->createLink($this->_linkProduct,BELONGS_TO);
|
| 64 |
$product = $this->_modelProductIndex->find($product_id);
|
| 65 |
$authorcomments = $this->_modelComment->findall('authorid='.$authorid .' and tid!='.$id,'created desc','3');
|
| 66 |
$productcomments = $this->_modelComment->findall('product_id='.$product['product_id'] .' and tid!='.$id,'created desc','3');
|
| 67 |
$seo_title = $comment1['subject']."-评:".$product['product']['brand'].$product['product']['product_name']."-好饰家";
|
| 68 |
include(TEMPLATE_DIR . '/comment_show.php');
|
| 69 |
}
|
| 70 |
}
|
| 71 |
?> |
Filename: /var/www/html/hsj/home/FLEA/FLEA/Dispatcher/Simple.php
#4
controller_comment::actionshow()
FILE: Simple.php
LINE: 127
ARGS:
Array
(
)
SOURCE CODE:
| 117 |
}
|
| 118 |
if (method_exists($controller, '__setDispatcher')) {
|
| 119 |
$controller->__setDispatcher($this);
|
| 120 |
}
|
| 121 |
|
| 122 |
// 调用 _beforeExecute() 方法
|
| 123 |
if (method_exists($controller, '_beforeExecute')) {
|
| 124 |
$controller->_beforeExecute($actionMethod);
|
| 125 |
}
|
| 126 |
// 执行 action 方法
|
| 127 |
$ret = $controller->{$actionMethod}();
|
| 128 |
// 调用 _afterExecute() 方法
|
| 129 |
if (method_exists($controller, '_afterExecute')) {
|
| 130 |
$controller->_afterExecute($actionMethod);
|
| 131 |
}
|
| 132 |
return $ret;
|
| 133 |
} while (false);
|
| 134 |
|
| 135 |
if ($callback) {
|
| 136 |
// 检查是否调用应用程序设置的错误处理程序
|
| 137 |
$args = array($controllerName, $actionName, $controllerClass);
|
Filename: /var/www/html/hsj/home/FLEA/FLEA/Dispatcher/Simple.php
#3
flea_dispatcher_simple::_executeaction('Comment', 'show', 'Controller_Comment')
FILE: Simple.php
LINE: 77
ARGS:
Array
(
[0] => Comment
[1] => show
[2] => Controller_Comment
)
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: /var/www/html/hsj/home/FLEA/FLEA.php
#2
flea_dispatcher_simple::dispatching()
FILE: FLEA.php
LINE: 621
ARGS:
Array
(
)
SOURCE CODE:
| 611 |
require_once($MVCPackageFilename);
|
| 612 |
}
|
| 613 |
FLEA::init();
|
| 614 |
|
| 615 |
// 载入调度器并转发请求到控制器
|
| 616 |
$dispatcherClass = FLEA::getAppInf('dispatcher');
|
| 617 |
FLEA::loadClass($dispatcherClass);
|
| 618 |
|
| 619 |
$dispatcher =& new $dispatcherClass($_GET);
|
| 620 |
FLEA::register($dispatcher, $dispatcherClass);
|
| 621 |
$dispatcher->dispatching();
|
| 622 |
}
|
| 623 |
|
| 624 |
/**
|
| 625 |
* 准备运行环境
|
| 626 |
*
|
| 627 |
* @param boolean $loadMVC
|
| 628 |
*/
|
| 629 |
function init($loadMVC = false)
|
| 630 |
{
|
| 631 |
static $firstTime = true;
|
Filename: /var/www/html/hsj/home/home.php
#1
flea::runmvc()
FILE: home.php
LINE: 42
ARGS:
Array
(
)
SOURCE CODE:
| 32 |
//FLEA框架文件
|
| 33 |
require('./FLEA/FLEA.php');
|
| 34 |
//公共函数库
|
| 35 |
require('./functions.php');
|
| 36 |
|
| 37 |
|
| 38 |
//导入框架配置参数
|
| 39 |
FLEA::loadAppInf('./config.php');
|
| 40 |
FLEA::setAppInf('dbDSN',$dsn);
|
| 41 |
FLEA::import(APP_DIR . DS . 'APP');
|
| 42 |
FLEA::runMVC();
|
| 43 |
|
| 44 |
|
| 45 |
?> |