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 'order by id_business desc limit 10' at line 1"
SQL 语句: " select * from xinwen_sort join business on id_sort = item_business and business.state=0 where parent= order by id_business desc limit 10"
SQL 错误代码: "7335941".
Filename: E:\wwwroot\st_xr\FLEA\FLEA\Db\Driver\Abstract.php [544]
#7 FLEA_Db_Driver_Mysql::execute(' select * from xinwen_sort ...')
ARGS:
Array
(
[0] => select * from xinwen_sort join business on id_sort = item_business and business.state=0 where parent= order by id_business desc limit 10
)
SOURCE CODE:
| 534 |
|
| 535 |
/**
|
| 536 |
* 执行一个查询,返回查询结果记录集
|
| 537 |
*
|
| 538 |
* @param string|resource $sql
|
| 539 |
*
|
| 540 |
* @return array
|
| 541 |
*/
|
| 542 |
function & getAll($sql)
|
| 543 |
{
|
| 544 |
$res = is_resource($sql) ? $sql : $this->execute($sql);
|
| 545 |
$rowset = array();
|
| 546 |
while ($row = $this->fetchAssoc($res)) {
|
| 547 |
$rowset[] = $row;
|
| 548 |
}
|
| 549 |
$this->freeRes($res);
|
| 550 |
return $rowset;
|
| 551 |
}
|
| 552 |
|
| 553 |
/**
|
| 554 |
* 执行查询,返回第一条记录的第一个字段
|
Filename: E:\wwwroot\st_xr\FLEA\FLEA\Db\TableDataGateway.php [702]
#6 FLEA_Db_Driver_Abstract::getAll(' select * from xinwen_sort ...')
ARGS:
Array
(
[0] => select * from xinwen_sort join business on id_sort = item_business and business.state=0 where parent= order by id_business desc limit 10
)
SOURCE CODE:
| 692 |
function & findBySql($sql, $limit = null)
|
| 693 |
{
|
| 694 |
// 处理 $limit
|
| 695 |
if (is_array($limit)) {
|
| 696 |
list($length, $offset) = $limit;
|
| 697 |
} else {
|
| 698 |
$length = $limit;
|
| 699 |
$offset = null;
|
| 700 |
}
|
| 701 |
if (is_null($length) && is_null($offset)) {
|
| 702 |
return $this->dbo->getAll($sql);
|
| 703 |
}
|
| 704 |
|
| 705 |
$result = $this->dbo->selectLimit($sql, $length, $offset);
|
| 706 |
if ($result) {
|
| 707 |
$rowset = $this->dbo->getAll($result);
|
| 708 |
} else {
|
| 709 |
$rowset = false;
|
| 710 |
}
|
| 711 |
return $rowset;
|
| 712 |
}
|
Filename: E:\wwwroot\st_xr\APP\Controller\indexNews.php [37]
#5 FLEA_Db_TableDataGateway::findBySql(' select * from xinwen_sort ...')
ARGS:
Array
(
[0] => select * from xinwen_sort join business on id_sort = item_business and business.state=0 where parent= order by id_business desc limit 10
)
SOURCE CODE:
| 27 |
|
| 28 |
FLEA::loadClass('FLEA_Helper_Pager');
|
| 29 |
$pager = new FLEA_Helper_Pager($this->modelNews,$page,$pagesize,$conditions,$sortby);
|
| 30 |
$data = $pager->findAll();
|
| 31 |
$viewData = array(
|
| 32 |
'pagerData' => $pager->getPagerData(),
|
| 33 |
'data' => $data
|
| 34 |
);
|
| 35 |
//dump($data[0]);die;
|
| 36 |
//最新发布
|
| 37 |
$hotNews=$this->modelNews->findbysql(" select * from xinwen_sort join business on id_sort = item_business and business.state=0 where parent=".$data[0]['xinwensort']['parent']." order by id_business desc limit 10");
|
| 38 |
$viewData["hotNews"]=$hotNews;
|
| 39 |
//dump($hotNews);die;
|
| 40 |
$Navigation=$this->modelMember->Navigation($_GET['sort']);
|
| 41 |
$viewData["Navigation"]=$Navigation;
|
| 42 |
$this->_executeView('index/newsList.htm',$viewData);
|
| 43 |
}
|
| 44 |
|
| 45 |
|
| 46 |
function actionShowContent(){
|
| 47 |
if(!empty($_GET['id'])){
|
Filename: E:\wwwroot\st_xr\FLEA\FLEA\Dispatcher\Simple.php [120]
#4 Controller_indexNews::actionNewsList()
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: E:\wwwroot\st_xr\FLEA\FLEA\Dispatcher\Auth.php [127]
#3 FLEA_Dispatcher_Simple::_executeAction('indexNews', 'NewsList', 'Controller_indexNews')
ARGS:
Array
(
[0] => indexNews
[1] => NewsList
[2] => Controller_indexNews
)
SOURCE CODE:
| 117 |
* @return mixed
|
| 118 |
*/
|
| 119 |
function dispatching()
|
| 120 |
{
|
| 121 |
$controllerName = $this->getControllerName();
|
| 122 |
$actionName = $this->getActionName();
|
| 123 |
$controllerClass = $this->getControllerClass($controllerName);
|
| 124 |
|
| 125 |
if ($this->check($controllerName, $actionName, $controllerClass)) {
|
| 126 |
// 检查通过,执行控制器方法
|
| 127 |
return $this->_executeAction($controllerName, $actionName, $controllerClass);
|
| 128 |
} else {
|
| 129 |
// 检查失败
|
| 130 |
$callback = FLEA::getAppInf('dispatcherAuthFailedCallback');
|
| 131 |
|
| 132 |
$rawACT = $this->getControllerACT($controllerName, $controllerClass);
|
| 133 |
if (is_null($rawACT) || empty($rawACT)) { return true; }
|
| 134 |
$ACT = $this->_auth->prepareACT($rawACT);
|
| 135 |
$roles = $this->_auth->getRolesArray();
|
| 136 |
$args = array($controllerName, $actionName, $controllerClass, $ACT, $roles);
|
| 137 |
|
Filename: E:\wwwroot\st_xr\FLEA\FLEA.php [816]
#2 FLEA_Dispatcher_Auth::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: E:\wwwroot\st_xr\index.php [13]
#1 FLEA::runMVC()
ARGS:
Array
(
)
SOURCE CODE:
| 3 |
date_default_timezone_set('Asia/Shanghai');//设置时区
|
| 4 |
define("COMM_DIR",str_replace("\\","/",dirname(__FILE__)."/comm"));//得到通用类路?
|
| 5 |
define("APP_DIR",dirname(__FILE__)."/APP");//得到应用程序的目?
|
| 6 |
define('NO_LEGACY_FLEAPHP',true);//代表是使用fleaphp1.0.7版本开发的
|
| 7 |
//defined('DEPLOY_MODE', false);
|
| 8 |
require('FLEA/FLEA.php');//加载FLEA框架入口函数
|
| 9 |
FLEA::loadAppInf('config/AppInf.php');//加载配置文件
|
| 10 |
FLEA::setAppInf(array('defaultController'=> 'index'));
|
| 11 |
FLEA::setAppInf(array('urlMode'=> URL_PATHINFO));
|
| 12 |
FLEA::import(APP_DIR);
|
| 13 |
FLEA::runMVC();
|
| 14 |
function deny(){
|
| 15 |
|
| 16 |
js_alert('没有访问权限!!',null,url('admin_login'));
|
| 17 |
}
|
| 18 |
?> |