top-think / top-think/think-orm
thinkphp6插入oracle数据库date类型字段报错
Open
Nobody has claimed this yet.
Oracle
- Dominant language
- PHP
- Stars
- 437
- Forks
- 188
- PR merge metrics
- No merged PRs in 30d
Description
$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数据啊?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported insert using the PHP data array and the Oracle CUSTOMER table, then trace how Think ORM binds the time value for this database. The issue names no source file or test; done would be a confirmed framework-level fix or a documented, verified way to handle the date value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100