jqgrid报表报错
程序员文章站
2022-05-29 16:18:36
...
jqgrid表格报错
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payments' in 'field list'
------解决方案--------------------
字段名是 payments-date 吗?中间有减号?
`payments-date`
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payments' in 'field list'
require_once '../../../jq-config.php';
// include the jqGrid Class
require_once ABSPATH."php/jqGrid.php";
// include the driver class
require_once ABSPATH."php/jqGridPdo.php";
// Connection to the server
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT id,order_id,payments-date FROM `sale_orders`';
// set the ouput format to json
$grid->dataType = 'json';
// Let the grid create the model from SQL query
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('grid.php');
// Set alternate background using altRows property
$grid->setGridOptions(array(
"rowNum"=>10,
"sortname"=>"id",
"altRows"=>true,
"multiselect"=>true,
"rowList"=>array(10,20,50),
));
// Change some property of the field(s)
$grid->setColProperty("id", array("label"=>"ID", "width"=>60));
$grid->setColProperty("payments-date", array(
"formatter"=>"date",
"formatoptions"=>array("srcformat"=>"Y-m-d H:i:s","newformat"=>"m/d/Y")
)
);
// Enjoy
$grid->renderGrid('#grid','#pager',true, null, null, true,true);
$conn = null;
?>
------解决方案--------------------
字段名是 payments-date 吗?中间有减号?
`payments-date`
相关文章
相关视频
专题推荐
-
独孤九贱-php全栈开发教程
全栈 170W+
主讲:Peter-Zhu 轻松幽默、简短易学,非常适合PHP学习入门
-
玉女心经-web前端开发教程
入门 80W+
主讲:灭绝师太 由浅入深、明快简洁,非常适合前端学习入门
-
天龙八部-实战开发教程
实战 120W+
主讲:西门大官人 思路清晰、严谨规范,适合有一定web编程基础学习
上一篇: 无语了小弟我!
下一篇: 安装俏微博源码出现的有关问题
推荐阅读
-
php 启动时报错的简单解决方法_PHP教程
-
下载python中Crypto库报错:ModuleNotFoundError: No module named ‘Crypto’的解决
-
页面上有语法错误不报错,而是直接页面无法加载【有图】
-
启动mysql的时候,报错pid的解决办法
-
Linux连接mysql报错:Access denied for user ‘root’@‘localhost’(using password: YES)的解决
-
PHP加密3DES报错 Call to undefined function: mcrypt_module_open() 如何解决,mcryptmoduleopen
-
PHP加密3DES报错 Call to undefined function: mcrypt_module_open() 如何解决,mcryptmoduleopen
-
ECSHOP完美解决Deprecated: preg_replace()报错的问题,ecshopdeprecated
-
MySQL使用GROUP BY分组查询报错 ,ONLY_FULL_GROUP_BY解决方案
-
MySQL 报错:#1 of ORDER BY clause is not in GROUP BY sql_mode=only_full_group_by
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论