Am I writing an application and using MySQL to return the difference between two dates in MySQL, if MySQL does this, or should I let PHP handle it?
I also need the sum of all the results that I return, should I return them and add them on the php side, or is there a way to add all the results together on the MySQL server side?
It depends on the application in some ways, but in general I would push it to PHP, because usually you create a website for several simultaneous accesses; why invest in a database and possibly have a bottleneck?
, . , , , , , , -. -, , - , . -, .
, , , , , . , , , . , , .
. SQL, , , , .
, MySQL :
SELECT id, SUM(price) FROM items GROUP BY id WITH ROLLUP
, id NULL, .
, . , , - . , , , , .
Source: https://habr.com/ru/post/1708348/More articles:ะัะพัะผะพัััะธะบ NLog ASP.Net - c#Does it assign a ticket number to check with version control, which is worth the effort for developers? - version-controlCreating a WPF Front End for a Silverlight 3.0 Application - wpfDoes it make sense to use byte-sized column lengths? - sql-serverUnicode issue with JSF and HTML? - javaHow can we transparently serialize Dataset ExtendedProperties in WCF? - serializationJquery auto-complete in dialog errors - jqueryIdentify the right developer tool based on real needs - version-controlJUnit MaxCore by ant - junithow to solve a VERY BIG URL problem for a hyperlink ... with jQuery or Javascript calling any perl, php etc. script on the back - javascriptAll Articles