RE: where is now() defined?

orchard <[email protected]>
Newsgroups gmane.comp.web.oscommerce.devel
Message-ID <aed8746166042472cb5d95c23745359d@osCommerce-Forums>
This message was sent from: Development
http://forums.oscommerce.com/viewtopic.php?p=180090#180090
----------------------------------------------------------------

Here's something that might work without editing 50 files.  In includes/functions/database.php, add a line at the beginning as shown below:[code]  function tep_db_query($query, $link = 'db_link') {
    global $$link, $logger;

// new line
    str_replace( 'now()', 'now() - interval 3 hour', $query );

    if (STORE_DB_TRANSACTIONS == 'true') {
      if (!is_object($logger)) $logger = new logger;
      $logger->write($query, 'QUERY');
    }

    $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());

    if (STORE_DB_TRANSACTIONS == 'true') {
      if (mysql_error()) $logger->write(mysql_error(), 'ERROR');
    }

    return $result;
  }[/code]This will do the equivalent of the edit for you on the fly at the cost of more server processing.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.