您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

jqgrid报表报错

2026/2/1 14:24:05发布12次查看
jqgrid表格报错
sqlstate[42s22]: column not found: 1054 unknown column 'payments' in 'field list'
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`
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product