SQLSTATE[42S22]: 列が見つかりません: 1054 'フィールド リスト' に不明な列 'payments'
<?phprequire_once '../../../jq-config.php';// include the jqGrid Classrequire_once ABSPATH."php/jqGrid.php";// include the driver classrequire_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 ?真ん中にマイナス記号はありますか? En `Payments-Date`
xuzuning は大きいため、元のフィールド名には中心線を使用できませんが、下線は使用できます