在coldfusion的mysql中插入mm-dd-yyyy日期时出错 [英] error while inserting mm-dd-yyyy date in mysql in coldfusion

查看:58
本文介绍了在coldfusion的mysql中插入mm-dd-yyyy日期时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




i在mySQL中插入诸如mm / dd / yyyy之类的日期格式时出现问题。
它显示日期格式错误。我的要求是输入像这样从前端(coldfusion)格式使用,我正在使用mySQL5作为数据库。


任何帮助都会大大增加。



i have a problem while inserting the date format like mm/dd/yyyy in mySQL.
It is showing the date format error.and my requirement is to enter like this format from front-end(coldfusion) and i am using mySQL5 as database.

any help would be greatly appriaciated.

谢谢

Yugal

Thanks
Yugal

推荐答案

确保保存日期是有效的日期,并使用 CreateODBCDate(yourDate) CreateODBCDateTime(yourDate)或更佳地让< cfqueryparam> 为您完成工作

Make sure the date to save is a valid date and either use CreateODBCDate(yourDate) or CreateODBCDateTime(yourDate) or better let <cfqueryparam> do the work for you

INSERT into myTable
(myDate)
VALUES
(<cfqueryparam cfsqltype="cf_sql_date" value="#yourDate#">)

这篇关于在coldfusion的mysql中插入mm-dd-yyyy日期时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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