RE: mysql/php date functions..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: bruce [mailto:bedouglas@xxxxxxxxxxxxx]
> Sent: Monday, September 26, 2005 2:46 PM
> To: 'John Nichel'; php-general@xxxxxxxxxxxxx
> Subject: RE:  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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux