scanreg Posted August 11, 2009 Share Posted August 11, 2009 I've noticed that there are a lot of things that can be done with either MySQL or PHP such as date stuff, math things, etc. When deciding which to use, I want to consider the following: 1. Server performance 2. Site performance 3. programming extensibility (meaning, maybe my stuff gets big enough that I need to rewrite things to work on a multi-server setup with load balancing, mysql on a separate server, ....) 4. Accuracy (precision in math results) What do you think? At first I thought I'd rely mostly on php but having looked more at mysql, those capabilities seem really nice too Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/169780-mysql-or-php-which-is-better/ Share on other sites More sharing options...
cunoodle2 Posted August 11, 2009 Share Posted August 11, 2009 Store all dates in mysql format (whenever possible). Php only really uses seconds since the epoch and it often just requires quite a bit of formatting to properly output/manipulate. Quote Link to comment https://forums.phpfreaks.com/topic/169780-mysql-or-php-which-is-better/#findComment-895691 Share on other sites More sharing options...
Maq Posted August 11, 2009 Share Posted August 11, 2009 I fail to understand the question. They are two totally different things. Such things as dates or math that you have to pull from the DB you want to take care of in SQL. Other than that I'm not sure what you're asking. Quote Link to comment https://forums.phpfreaks.com/topic/169780-mysql-or-php-which-is-better/#findComment-895692 Share on other sites More sharing options...
premiso Posted August 11, 2009 Share Posted August 11, 2009 It depends on what you require. If you do not need anything but the raw data pulled out...then MySQL alone would be great. If you want to make it look like a report and manipulate the data and pretty it up you will need PHP with MySQL, as they do go hand in hand to help each other. But as said, if you just need it for numbers and small reports, MySQL will be fine, just the data would have to be pulled out using the command line or a script in MySQL which will only give you raw text in a table format vs having PHP pull it out and dressing it up a bit. As far as accuracy on math. It is only as accurate as you code it. You code it wrong it will be off, of course. That all depends on your knowledge and skills. Performance...really you cannot compare them as one is a Database and the other is a Markup/programming Language. Quote Link to comment https://forums.phpfreaks.com/topic/169780-mysql-or-php-which-is-better/#findComment-895696 Share on other sites More sharing options...
Adam Posted August 11, 2009 Share Posted August 11, 2009 To be honest I've never seen as it as having to choose between the two. They do their own things, obviously some functionality can be seen as the same but you just go with the flow. I've never purposefully used MySQL for something in this sense, when the rest of the processing is done by PHP, or the other way round. Quote Link to comment https://forums.phpfreaks.com/topic/169780-mysql-or-php-which-is-better/#findComment-895703 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.