Jump to content


Photo

**SOLVED** Insert Date


  • Please log in to reply
2 replies to this topic

#1 natalieG

natalieG
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 18 May 2006 - 07:59 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.

Janie


#2 Barand

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

Posted 18 May 2006 - 08:12 PM

After the line

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

what does this give

echo $NOTEDATE;

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






moon.png

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

#3 natalieG

natalieG
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 18 May 2006 - 09:20 PM

Thanks, we found the problem and it works. It was a dumb error and we are sorry to bother you.

Nancy




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users