Exception: FLEA_Db_Exception_SqlQuery
Message: SQL 错误消息: "Field 'title' doesn't have a default value"
SQL 语句: "INSERT INTO `articles` (`views`, `created`, `updated`) VALUES (1639,1284125535,1284125535)"
SQL 错误代码: "7335941".
Filename: D:\Jerry\xuanse_net\web\FLEA\FLEA\Db\TableDataGateway.php [1100]
#7 FLEA_Db_Driver_Mysql::execute('INSERT INTO `articles` (`vi ...', array(3), 1)
ARGS:
Array
(
[0] => INSERT INTO `articles` (`views`, `created`, `updated`) VALUES (?,?,?)
[1] => Array
(
[views] => 1639
[created] => 1284125535
[updated] => 1284125535
)
[2] => 1
)
SOURCE CODE:
| 1090 |
return false;
|
| 1091 |
}
|
| 1092 |
|
| 1093 |
// 生成 SQL 语句
|
| 1094 |
list($holders, $values) = $this->dbo->getPlaceholder($row, $this->fields);
|
| 1095 |
$holders = implode(',', $holders);
|
| 1096 |
$fields = $this->dbo->qfields(array_keys($values));
|
| 1097 |
$sql = "INSERT INTO {$this->qtableName} ({$fields}) VALUES ({$holders})";
|
| 1098 |
|
| 1099 |
// 插入数据
|
| 1100 |
if (!$this->dbo->Execute($sql, $values, true)) {
|
| 1101 |
if ($unsetpk) { unset($row[$this->primaryKey]); }
|
| 1102 |
$this->dbo->completeTrans(false);
|
| 1103 |
return false;
|
| 1104 |
}
|
| 1105 |
|
| 1106 |
// 如果提交的数据中没有主键字段值,则尝试获取新插入记录的主键值
|
| 1107 |
if (is_null($insertId)) {
|
| 1108 |
$insertId = $this->dbo->insertId();
|
| 1109 |
if (!$insertId) {
|
| 1110 |
if ($unsetpk) { unset($row[$this->primaryKey]); }
|
Filename: D:\Jerry\xuanse_net\web\FLEA\FLEA\Db\TableDataGateway.php [746]
#6 FLEA_Db_TableDataGateway::create(array(3), 1, 1)
ARGS:
Array
(
[0] => Array
(
[views] => 1639
[created] => 1284125535
[updated] => 1284125535
)
[1] => 1
[2] => 1
)
SOURCE CODE:
| 736 |
*
|
| 737 |
* @param array $row
|
| 738 |
* @param boolean $saveLinks
|
| 739 |
* @param boolean $updateCounter
|
| 740 |
*
|
| 741 |
* @return boolean
|
| 742 |
*/
|
| 743 |
function save(& $row, $saveLinks = true, $updateCounter = true)
|
| 744 |
{
|
| 745 |
if (empty($row[$this->primaryKey])) {
|
| 746 |
return $this->create($row, $saveLinks, $updateCounter);
|
| 747 |
} else {
|
| 748 |
return $this->update($row, $saveLinks, $updateCounter);
|
| 749 |
}
|
| 750 |
}
|
| 751 |
|
| 752 |
/**
|
| 753 |
* 保存一个记录集(多行数据)
|
| 754 |
*
|
| 755 |
* @param array $rowset
|
| 756 |
* @param boolean $saveLinks
|
Filename: D:\Jerry\xuanse_net\web\APP\Controller\art.php [68]
#5 FLEA_Db_TableDataGateway::save(array(3))
ARGS:
Array
(
[0] => Array
(
[views] => 1639
[created] => 1284125535
[updated] => 1284125535
)
)
SOURCE CODE:
| 58 |
if($art['views']==0){ // 搞鬼
|
| 59 |
$num = 1638;
|
| 60 |
}else{
|
| 61 |
$num = $art['views'];
|
| 62 |
}
|
| 63 |
$data = array(
|
| 64 |
'article_id' => $artid,
|
| 65 |
'views' => $num+1,
|
| 66 |
);
|
| 67 |
|
| 68 |
$this->_tbArticles->save($data);
|
| 69 |
|
| 70 |
include(TPL_DIR.'/art.php');
|
| 71 |
}
|
| 72 |
|
| 73 |
|
| 74 |
};
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
?> |
Filename: D:\Jerry\xuanse_net\web\FLEA\FLEA\Dispatcher\Simple.php [120]
#4 Controller_Art::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:\Jerry\xuanse_net\web\FLEA\FLEA\Dispatcher\Auth.php [127]
#3 FLEA_Dispatcher_Simple::_executeAction('art', 'show', 'Controller_art')
ARGS:
Array
(
[0] => art
[1] => show
[2] => Controller_art
)
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: D:\Jerry\xuanse_net\web\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: D:\Jerry\xuanse_net\web\index.php [46]
#1 FLEA::runMVC()
ARGS:
Array
(
)
SOURCE CODE:
| 36 |
//设置webcontrols扩展的目录
|
| 37 |
FLEA::setAppInf('webControlsExtendsDir', dirname(__FILE__).'/FLEA/FLEA/WebControls');
|
| 38 |
|
| 39 |
//载入应用程序设置
|
| 40 |
FLEA::loadAppInf(APP_DIR . '/Config/APP_INF.php');
|
| 41 |
FLEA::loadAppInf(APP_DIR . '/Config/SHARE_APP_INF.php');
|
| 42 |
//加载所有的类
|
| 43 |
|
| 44 |
FLEA::import(APP_DIR);
|
| 45 |
|
| 46 |
FLEA::runMVC();
|
| 47 |
|
| 48 |
|
| 49 |
// define the dispatcher failed callback function
|
| 50 |
function onDispatcherFailedCallback($controller,$action)
|
| 51 |
{
|
| 52 |
echo "<h4>错误!</h4>";
|
| 53 |
echo "请求的控制器是:".$controller;
|
| 54 |
echo "<br>请求的动作是:".$action;
|
| 55 |
echo "<br><br>但是该控制器或者该动作并未定义。<br><br>";
|
| 56 |
echo '<a href="/">返回首页</a> 或 联系<a href="http://www.caoguo.com/">UUTAN</a>解决问题';
|