think-orm icon indicating copy to clipboard operation
think-orm copied to clipboard

thinkphp6插入oracle数据库date类型字段报错

Open rehack opened this issue 2 years ago • 0 comments

$data = [
'name'=>$param['name'],
'phone'=>$param['phone'],
'time'=>date('Y/m/d H:i:s' ,time())
];
Db::table('CUSTOMER')->strict(false)->insert($data);

执行插入的时候就会报错: SQLSTATE[HY000]: General error: 1861 OCIStmtExecute: ORA-01861: 文字与格式字符串不匹配

尝试使用http://www.thinkphp.cn/topic/27014.html 这个方法 也不行 请教下该怎么处理time数据啊?

rehack avatar Nov 02 '21 07:11 rehack