如何使用php将日期时间值存储到mysql表 [英] how to store datetime values to mysql table using php

查看:120
本文介绍了如何使用php将日期时间值存储到mysql表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我有一个文本框[datetimepicker]。

当我们选择它时会显示格式为dd / mm / yyyy hh:mm

例如:24/04/2014 11:00

现在我需要使用php将这个值存储到mysql表中。

我有一个属性约会,类型为'datetime'

i试过但我没有解决。

i使用下面的代码,但它不会解决我的问题

Hello i'm having a textbox [datetimepicker].
when we select it will show like a format dd/mm/yyyy hh:mm
eg: 24/04/2014 11:00
now i need to store this value to mysql table using php.
i'm having an attribute appointment which is in type 'datetime'
i tried but i did not solved.
i used the following code but it will not solved my problem

$papp=$_POST['papp'];
    $papp = date("Y-m-d h:i:s",  strtotime($papp));



它给出的结果如1970-01-01 05:30:00



请解决我的问题..

提前感谢


it give a result like 1970-01-01 05:30:00

kindly solve my pblm..
thanks in advance

推荐答案

papp =


_POST [' papp'];
_POST['papp'];


papp = date( Ymd h:i:s,strtotime(
papp = date("Y-m-d h:i:s", strtotime(


这篇关于如何使用php将日期时间值存储到mysql表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆