natalieG Posted May 18, 2006 Share Posted May 18, 2006 we have a table with a column called NOTEDATE which is of type DATE. We are calcuating thecolumn value by the followingL[b]$NOTEDATE= $YEAR . '-' . $MONTH . '-' . $DAYARRAY[$DAY]; [/b]where $DATARRAY[] returns the string vakuer for the form daee in YYYY-MM-DD format. We checked this put and it does indeed pront the desired string. But, when we use the string in an Insertquery by putting '$NOTEDATE' in the inseert query, the date shows up invalid'0000-00-00'. I thoughtthis format was legal.Janie Quote Link to comment https://forums.phpfreaks.com/topic/9948-solved-insert-date/ Share on other sites More sharing options...
Barand Posted May 18, 2006 Share Posted May 18, 2006 After the line[code]$NOTEDATE= $YEAR . '-' . $MONTH . '-' . $DAYARRAY[$DAY];[/code]what does this give[code]echo $NOTEDATE;[/code] Quote Link to comment https://forums.phpfreaks.com/topic/9948-solved-insert-date/#findComment-36993 Share on other sites More sharing options...
natalieG Posted May 18, 2006 Author Share Posted May 18, 2006 Thanks, we found the problem and it works. It was a dumb error and we are sorry to bother you.Nancy Quote Link to comment https://forums.phpfreaks.com/topic/9948-solved-insert-date/#findComment-37003 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.