Online Promoters™ :: Web Development made simple

Tag Archives: php date

MySQL CURDATE() and NOW() vs. PHP date() – heavy server load

Let's assume the following: - we have a MySQL table with some fields like "product", "dateX" and "dateY"; - the "product" is a "varchar" type; - the "dateX" and "dateY" field type is "date" - YYYY-MM-DD; SCENARIO 1: If we are using the mysql NOW() and CURDATE() native function the query would look like this: [sourcecode language="php"] SELECT product FROM table WHERE dateX <= NOW()...

by Webmaster