Hi all I have a problem and hope someone here could help. I have a page where you add reviews to specific bars etc. On the form page I have the date as - DateFormat(now(), "yyyy/mm/dd") I'm passing the date to the insert page and the code to insert into MySQL is - '#dateformat(adddate,"yyyy/dd/mm")#' The MySQL DB, the field is called adddate, the type is date and nothing else is filled in. It was working the other day but today when a comment is added the adddate is set to 0000-00-00 Anyone got any ideas? JP
try printing the variable just prior to building the sql statement. If that looks ok, then print the built sql statement instead of running it. If you can't spot the problems there, post the sql here and we'll look at it.
The page before will print out the date with no problem, the insert page aint showing it. I'm at a loss, yesterday this was working fine, today nothing. I've sent my host a e-mail to see if they changed something as I've not changed a thing (apart from this afternoon trying to fix it)
Right, host has changed nothing yesterday but today that un-changed code is not working... So if anyone is willing to help. Programming is in Coldfusion but it runs SQL stylie code before the SQL insert. <cfset today = DateFormat(now(), "yyyy/mm/dd")> <tr> <td class="tabletext"><cfoutput><input type="text" name="adddate" readonly="readonly" value="#today#" size="20"></cfoutput></td> </tr> (part of the forum) The insert page; <cfquery datasource="puerto_info" username="#application.dsnusername#" password="#application.dsnpassword#" name="insert_comment"> INSERT INTO comments (adddate,firstname,lastname,email,comment,barid,rating) VALUES ('#dateformat(adddate,"yyyy/dd/mm")#','#firstname#','#lastname#','#email#','#comment#','#barid#','#rating#') </CFQUERY> So.. the problem I seem to have is in the SQL DB, after a person submits a comment/rating the date is being inserted as 0000-00-00 So any thoughts?