无法获得输出日期。以yyyy-mm-dd的日期格式输出全零,并显示为0000-00-00 [英] Cannot get the date to output right. Outputs all zeros in date format of yyyy-mm-dd and it shows as 0000-00-00

查看:472
本文介绍了无法获得输出日期。以yyyy-mm-dd的日期格式输出全零,并显示为0000-00-00的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将日期在PHPMYAdmin中正确显示为正确的日期,但所有显示的都是0000-00-00。我肯定知道有一个角色关闭,它需要改变一些东西,但我无法弄清楚我的生活。



 $ sql =UPDATE CreditTracker SET Approve = \$ Approve \,ClassWkshp = \ClassWkshp \,Sponsor = \$ Sponsor \,Type = \$ Type \,HrsUnits = \HrsUnits \,日期= \$ Date \,$ DateApproved WHERE idnum = \$ idnum \; 





这是代码,有人可以告诉我为什么它不会工作。怎么了??在此声明中,为什么它会将Date显示为0000-00-00而不是实际日期。例如,它应该以2019-05-21为例。



PEASE HELP !!!!



我尝试了什么:



我试过替换某些t变量并查看从mysql调用的语法,语句是生成没有错误,但日期不会因某种原因而改变。不知道发生了什么。

解决方案

sql =UPDATE CreditTracker SET Approve = \


Approve \ ,ClassWkshp = \ ClassWkshp\,赞助= \

Sponsor\,类型= \

I am trying to get the date to display correctly in PHPMYAdmin as the correct date but all it shows is 0000-00-00. I know for sure there is a character off and it needs changed to something but I cannot figure it out for the life of me.

$sql="UPDATE CreditTracker SET Approve=\"$Approve\",ClassWkshp=\"ClassWkshp\",Sponsor=\"$Sponsor\",Type=\"$Type\",HrsUnits=\"HrsUnits\",Date=\"$Date\",$DateApproved WHERE idnum=\"$idnum\"";



Here is the code and can someone show me why it wont work. What is wrong?? In this statement, why would it show the Date as 0000-00-00 instead of an actual date. For example it should read 2019-05-21 for example.

PEASE HELP!!!!

What I have tried:

I have tried replacing certain t variables and looking at syntax as it is called from mysql and the statement is generating with no error but the date wont change for some reason. Not sure what is going on.

解决方案

sql="UPDATE CreditTracker SET Approve=\"


Approve\",ClassWkshp=\"ClassWkshp\",Sponsor=\"


Sponsor\",Type=\"


这篇关于无法获得输出日期。以yyyy-mm-dd的日期格式输出全零,并显示为0000-00-00的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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