Jump to content


Date Insert

  • Please log in to reply
1 reply to this topic

#1 natalieG

  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 18 May 2006 - 08:01 PM

we have a table with a column called NOTEDATE which is of type DATE. We are calcuating the
column value by the followingL

$NOTEDATE= $YEAR . '-' . $MONTH . '-' . $DAYARRAY[$DAY];

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 Insert
query by putting '$NOTEDATE' in the inseert query, the date shows up invalid'0000-00-00'. I thought
this format was legal.


#2 Barand

  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 18 May 2006 - 08:16 PM

After the line
$NOTEDATE= $YEAR . '-' . $MONTH . '-' . $DAYARRAY[$DAY];

what does this output

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received


|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users