|
Posted by Jim Moseby on 09/26/05 22:20
> -----Original Message-----
> From: bruce [mailto:bedouglas@earthlink.net]
> Sent: Monday, September 26, 2005 2:46 PM
> To: 'John Nichel'; php-general@lists.php.net
> Subject: RE: [PHP] mysql/php date functions..
>
>
> john...
>
> that appears to be it!! although i would have assumes it
> would have done a
> most significant bit fill with 0's...
>
> so my question also comes down to .. do i use the php date
> functions for
> date/time manipulation.. or do i use the mysql functions....
>
> any thoughts/suggestions...
>
> -bruce
>
That depends largely on the situation. For instance, if you want to
increment a date in a MySQL table, you would likely do it with a MySQL
statement, because to do it in PHP, you need to do a read, then add the day,
then a write, (two DB calls). With MySQL, you would just do something like:
update `mytable` set 'columnname` date_add(columnname, interval 1 day);
One call to the DB instead of two, much more efficient.
There are many instances where you would want to use PHP to manipulate dates
too, depending on their circumstances.
JM
Navigation:
[Reply to this message]
|