Jump to content


Does mysql 4.0.15 support date()?

  • Please log in to reply
2 replies to this topic

#1 ngubie

  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 27 October 2006 - 03:05 PM

Hi guys,

I got mysql 4.0.15 running on my computer, but 4.1.16 running on the network in the office. I used to design the site on my computer, then transfer it over to the office server, and everything was working fine.

Then my personal comp got wiped, I reinstalled the local server, and now the mysql queries arent working anymore.

I've narrowed the problem down to the date() function. if I do
I get a query syntax error. but if I just do
everything works, but I get the whole timestamp instead of just the date.

Everything on the office server still works just as it should, but I would really like to get it up and running properly on my personal comp too, so...

Does mysql 4.0.15 support the date() function?
Why did it work before the wipe, but not after, even though everything should be the same still?
Is there anything I can do to get it running on the personal comp? I really don't want to change the coding if it should be working properly but isnt due to a server problem.


#2 Barand

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

Posted 28 October 2006 - 08:52 AM

Extracts the date part of the date or datetime expression expr.
mysql> SELECT DATE('2003-12-31 01:02:03');
        -> '2003-12-31'

DATE() is available as of MySQL 4.1.1.

So if I can find it in the manual, why can't you?

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

#3 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 28 October 2006 - 04:09 PM

In the meanwhile, you can use EXTRACT(), AFAIK.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users