RE: [PHP] mysql/php date functions..

From: Date: Mon, 26 Sep 2005 19:20:37 +0000
Subject: RE: [PHP] mysql/php date functions..
Groups: php.general 
Request: Send a blank email to php-general+get-223225@lists.php.net to get a copy of this message
> -----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

« previous php.general (#223225) next »