【发布时间】:2015-02-04 15:07:53
【问题描述】:
我有这个数据库(mysql):
我有代码:
$day = $app->request->post('day');
$startLocation = $app->request->post('startLocation');
$datum = new DateTime();
$startTime = $datum->getTimestamp(); //this line is IMPORTANT
global $user_id;
$db = new DbHandler();
// creating new task
$day_id = $db->createDay($user_id, $day, $startLocation, $startTime); ETC...
但我无法将timestamp 的数据提交到startTime 的数据库中,女巫有type timestamp
为什么?该怎么做?
【问题讨论】:
-
你有什么错误吗?如果是,您能否提供错误文本?
-
不,因为后端是 REST api 服务,我尝试在其上添加数据...我将其发送到数据库:startTime: 1417878370,但该数据未在数据库中提交
标签: php mysql date mysqli timestamp