#1
  1. No Profile Picture
    Robocop
    Guest
    Devshed Newbie (0 - 499 posts)
    Hi Peeps,

    I'm developing a simple web application using php3 and mysql. My problem is the mysql date format. I'm using dates of the form
    YYYY-MM-DD, just as mysql likes. The problem is if I make a query using a date in that same format, mysql does not match it up correctly with dates stored in the table. It only works if I ditch the delimiters like YYYYMMDD. I can work around the problem, but it's been bugging me why it won't work.

    Any Ideas? Is it me?

    PS Devshed ROCKS!!
  2. #2
  3. No Profile Picture
    Pointman
    Guest
    Devshed Newbie (0 - 499 posts)
    When inserting the current date, use the mysql CURDATE() function instead of PHP's date function. Use CURDATE() +0 to get YYYYMMDD instead of YYYY-MM-DD.

Similar Threads

  1. Replies: 3
    Last Post: January 28th, 2010, 02:14 PM
  2. Date Problem with Mysql and PHP
    By cadams in forum MySQL Help
    Replies: 7
    Last Post: January 7th, 2004, 01:40 PM
  3. PHP's date() - not in sync - mySQL now()
    By please_explain in forum PHP Development
    Replies: 1
    Last Post: October 26th, 2003, 03:16 PM
  4. Errcode:13 . How to solve it on MySQL + Windows 2000
    By hankycheng in forum MySQL Help
    Replies: 28
    Last Post: August 3rd, 2003, 10:05 AM
  5. Text formatting problem with mysql
    By DaveK in forum PHP Development
    Replies: 1
    Last Post: September 3rd, 2001, 01:55 PM

IMN logo majestic logo spyfu logo threadwatch logo seochat tools logo