top-think / top-think/think-orm

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

Open
#307 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.