您好,欢迎访问一九零五行业门户网

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`
xuzuning大大:
       `payments-date`名称是这样的,中间有减号??那个报错是说字段名不对??
xuzuning大大,原来字段名称不能用中线,下划线就可以
其它类似信息

推荐信息