Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'mysql dates'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. I was perplexed why the same script yielded different results on my local and remote servers: In a mySql database (locally) I have "0000-00-00" in the Date column (formatted as a date). I have the same thing in my remote server. A select statement for retrieved the value of the 'paid thru' column for a member whom has never made a dues payment has always been set to "0000-00-00" by design. strtotime ($paid_thru) would therefor yield a gigantic negative number on my local server and serve the purpose for the conditional: if (strtotime ($paid_thru) <0) { ....} The same thing on the remote server yields no value at all and stopped all the gears. After several head-scratching minutes, I decided to change the "0000-00-00" scheme to the arbitrary date of 1969-06-06 ( a great year as some of us recall -Larry?). Discovering the db concept of "The Epoch" year, 1970-01-01, -which, as far as sql servers is concerned, is the beginning of the universe- 1969 was a time before time actually existed and therefore yielded a negative value instead of nothing from the remote. Because no member would never have gotten this far without paying their dues since "the summer of love" without getting the boot, this will work. But my actual question: I'm guessing that my version of PHP or MYSQL is earlier than that on the remote server. But which one? Does mySQL no longer treat 0000-00-00 like a date (though it still allows it in a date formatted column" or does the 'strtotime' php function no longer do the math on it as it used to? p.s. If I echo $paid_thru, it prints out 0000-00-00 on both servers and this was what was throwing me. (so maybe it's the php version?)
×
×
  • Create New...