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 type=2' at line 3"
SQL 语句: "SELECT `resouces`.*
FROM `resouces`
WHERE related_id= and type=2"
SQL 错误代码: "7335941".
Filename: /var/www/html/hsj/home/FLEA/FLEA/Db/Driver/Mysql.php
#7
flea_db_exception_sqlquery::flea_db_exception_sqlquery('SELECT `resouces`.*
FROM `r ...', 'You have an error in your S ...', 1064)
FILE: Mysql.php
LINE: 230
ARGS:
Array
(
[0] => SELECT `resouces`.*
FROM `resouces`
WHERE related_id= and type=2
[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 type=2' 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/TableDataGateway.php
#6
flea_db_driver_mysql::execute('SELECT `resouces`.*
FROM `r ...')
FILE: TableDataGateway.php
LINE: 397
ARGS:
Array
(
[0] => SELECT `resouces`.*
FROM `resouces`
WHERE related_id= and type=2
)
SOURCE CODE:
| 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();
|
| 406 |
$assocRowset = null;
|
| 407 |
$rowset = $this->dbo->getAllWithFieldRefs($result,
|
Filename: /var/www/html/hsj/home/APP/Controller/product.php
#5
model_resource::findall('related_id= and type=2')
FILE: product.php
LINE: 250
ARGS:
Array
(
[0] => related_id= and type=2
)
SOURCE CODE:
| 240 |
$pid = $product['product_id'];
|
| 241 |
$shop_id = $product['shop_id'];
|
| 242 |
$username = $product['shop_info']['username'];
|
| 243 |
$class_id = $product['class_id'];
|
| 244 |
$model_id = $product['class_info']['model_id'];
|
| 245 |
$keywords1 = explode(",",$product['product_info']['Keyword']);
|
| 246 |
$big_class_id = $product['shop_big_class_id'];
|
| 247 |
$path = $this->getpath($class_id) . ' » <strong>' .$product['product_info']['product_name']. '</strong>';
|
| 248 |
$md_id = $product['shop_info']['md_id'];
|
| 249 |
$Model_ProductPhoto =& FLEA::getSingleton('Model_Resource');
|
| 250 |
$ProductPhoto = $Model_ProductPhoto->findall('related_id='.$pid. ' and type=2');
|
| 251 |
if($model_id) {
|
| 252 |
$Model_AddonProduct =& FLEA::getSingleton('Model_AddonProduct'.$model_id);
|
| 253 |
$AddonProduct = $Model_AddonProduct->find('product_id='.$product_id);
|
| 254 |
$Addon_dir = CACHE_DIR.'common/cache_addonproduct_'.$model_id.'.php';
|
| 255 |
if(is_file($Addon_dir)) {
|
| 256 |
include(CACHE_DIR.'common/cache_addonproduct_'.$model_id.'.php');
|
| 257 |
$cache_name = 'addonproduct_'.$model_id;
|
| 258 |
$model_field_list = $_CACHE[$cache_name];
|
| 259 |
}
|
| 260 |
//dump($AddonProduct);
|
Filename: /var/www/html/hsj/home/FLEA/FLEA/Dispatcher/Simple.php
#4
controller_product::actionpreview()
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('product', 'preview', 'Controller_product')
FILE: Simple.php
LINE: 77
ARGS:
Array
(
[0] => product
[1] => preview
[2] => Controller_product
)
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 |
?> |