这个错误。注意看加粗部分,在不同环境中有时 `formattribute` = '' 有时 `formattribute` = null导致报错。
在代码里面:
$data['formattribute'] = $_POST['formattribute']; //表单附加属性
然后使用$editdata= $this->create($data)接着使用$this->save($editdata)进行更新。其中$_POST数组中,不存在$_POST['formattribute']。在TP3.0时,没发现有啥问题。在TP3.1的时候,在有的环境下,组合SQL的时候,会把`formattribute`=null了导致SQL报错。求解。
最佳答案