general rule for when to perform an operation in either Mysql or php
| From: | daniel smith | Date: | Sun, 29 Jan 2006 16:20:08 +0000 |
| Subject: | general rule for when to perform an operation in either Mysql or php | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-41145@lists.php.net to get a copy of this message | ||
I am playing around with Mysql and php and I am not sure about when it
is best do something in mysql or php when BOTH can perform the
operation.
Example, date formating can be performed by Mysql during the query
DATE_FORMAT(blah, blah...) or by php with date(blah, blah..). What are
the upsides/downsides of doing something like this in Mysql/php.
My current (though limited) thinking is not much improvement in either
approach over the other in both operations are performed by the same
server. I can only see a difference when using huge databases and the
database is on a different machine.
What is considered to be "Best practise" when Mysql and php can perform
the same operation?