DataObject: Overriding select syntax to include sql functions. MySQL convert_tz( )
| From: | JEnsign | Date: | Tue, 01 Feb 2005 18:46:57 +0000 |
| Subject: | DataObject: Overriding select syntax to include sql functions. MySQL convert_tz( ) | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17325@lists.php.net to get a copy of this message | ||
Hi all,
I am using MySQL and its timezone functions.
I need a way to override ONLY the SQL selects used by some of my dataobjects, so I can easily deal with date/time conversion per timezone.
Ideally, if I could just write something once in the parent class that all my dataobjects extend that would be... well dreamy : )
Usage as:
SELECT CONVERT_TZ( last_update,'UTC','America/Denver') from some_table;
I hope im being clear : ) I need to inject sql functions into the sql used by various dataobjects.
Does anyone know how to insert sql function calls into the dataobjects without having to manually write out the sql and use query( ) everytime?
What is the best approach to solving this?
Thanks,
John