Results 1 to 4 of 4

Thread: [RESOLVED] php / mysql date

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Resolved [RESOLVED] php / mysql date

    PHP Code:
    if(strtotime($c_end) !== false) {
        
    $c_enddate=date('Y-m-d',strtotime($c_end));
    }else{
       
    $c_end='DEFAULT';
    }

    $query="INSERT INTO contests VALUES(DEFAULT,'" $c_title "','" getUrl($c_url) . "','" $c_url "','" $c_loc "'," $c_ref "," $c_day ",'" $c_host "'," $c_enddate ",DEFAULT,'" $user "',0)"
    the MYSQL table field is DATE (not DATETIME)

    its converting properly.... 9/22/2014 = 2014-9-22 but the date is appearing in the table as 0000-00-00??
    i know I am missing something stupid lol
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: php / mysql date

    .... sigh.. yep.. stupid.

    forgot the ' 's around the date in the query
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: php / mysql date

    Is this resolved?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  4. #4

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: php / mysql date

    sorry.. yes
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width