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 '' at line 1"
SQL 语句: "SELECT `picture`.* FROM `picture` WHERE pid= "
SQL 错误代码: "7335941".
Filename: D:\freehost\yifei2\web\flea\FLEA\Db\TableDataGateway.php [448]
#6 FLEA_Db_Driver_Mysql::execute('SELECT `picture`.* FROM `p ...')
ARGS:
Array
(
[0] => SELECT `picture`.* FROM `picture` WHERE pid=
)
SOURCE CODE:
| 438 |
// 当有关联需要处理时,必须获得主表的主键字段值
|
| 439 |
$sql = "SELECT {$distinct} {$this->qpka}, {$fields} FROM {$this->qtableName} {$whereby} {$sortby}";
|
| 440 |
} else {
|
| 441 |
$sql = "SELECT {$distinct} {$fields} FROM {$this->qtableName} {$whereby} {$sortby}";
|
| 442 |
}
|
| 443 |
|
| 444 |
// 根据 $length 和 $offset 参数决定是否使用限定结果集的查询
|
| 445 |
if (null !== $length || null !== $offset) {
|
| 446 |
$result = $this->dbo->selectLimit($sql, $length, $offset);
|
| 447 |
} else {
|
| 448 |
$result = $this->dbo->execute($sql);
|
| 449 |
}
|
| 450 |
|
| 451 |
if ($enableLinks) {
|
| 452 |
/**
|
| 453 |
* 查询时同时将主键值单独提取出来,
|
| 454 |
* 并且准备一个以主键值为键名的二维数组用于关联数据的装配
|
| 455 |
*/
|
| 456 |
$pkvs = array();
|
| 457 |
$assocRowset = null;
|
| 458 |
$rowset = $this->dbo->getAllWithFieldRefs($result, $this->pka, $pkvs, $assocRowset);
|
Filename: D:\freehost\yifei2\web\app\front\Controller\product.php [91]
#5 FLEA_Db_TableDataGateway::findAll('pid=')
ARGS:
Array
(
[0] => pid=
)
SOURCE CODE:
| 81 |
$this->_executeView('product.html',$this->data);
|
| 82 |
}
|
| 83 |
//获取单个产品
|
| 84 |
function actionshow(){
|
| 85 |
//获取分类
|
| 86 |
$pid = intval(empty($_GET['pid'])?0:$_GET['pid']);
|
| 87 |
!$pid && showmsg('参数错误');
|
| 88 |
$this->_Product = & FLEA::getSingleton('table_product');
|
| 89 |
$rows = $this->_Product->find("id={$pid}");
|
| 90 |
//获取每个产品的图片集
|
| 91 |
$tmppic = $this->_modelPicture->findAll('pid=' . $rows['id']);
|
| 92 |
$rows['picture'] = array();
|
| 93 |
if($tmppic){
|
| 94 |
foreach($tmppic as $val) {
|
| 95 |
$rows['picture'][] = $val['pictures'];
|
| 96 |
}
|
| 97 |
}
|
| 98 |
$catelist=$this->_Cate->getCate();//获取所有 产品 分类
|
| 99 |
$tmp = array('row'=>$rows, 'catelist'=>$catelist);
|
| 100 |
$this->data = array_merge($tmp, $this->data);
|
| 101 |
$this->_executeView('product_detail.html',$this->data);
|
Filename: D:\freehost\yifei2\web\flea\FLEA\Dispatcher\Simple.php [120]
#4 Controller_product::actionshow()
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: D:\freehost\yifei2\web\flea\FLEA\Dispatcher\Simple.php [77]
#3 FLEA_Dispatcher_Simple::_executeAction('product', 'show', 'Controller_product')
ARGS:
Array
(
[0] => product
[1] => show
[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: D:\freehost\yifei2\web\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: D:\freehost\yifei2\web\index.php [83]
#1 FLEA::runMVC()
ARGS:
Array
(
)
SOURCE CODE:
| 73 |
);
|
| 74 |
|
| 75 |
FLEA::setAppInf($tpl);
|
| 76 |
require('include/front_init.php');
|
| 77 |
require('include/function.php');
|
| 78 |
/**导入前端程序**/
|
| 79 |
FLEA::import('app/front');
|
| 80 |
// exit('1111');
|
| 81 |
/**设置URL模式**/
|
| 82 |
//FLEA::setAppInf('urlMode', URL_PATHINFO);//URL_REWRITE
|
| 83 |
FLEA::runMVC();
|
| 84 |
// echo "1";die;
|
| 85 |
?>
|