mamad876 Posted April 28, 2008 Share Posted April 28, 2008 Hello all, I have a problem, that I thought maybe some one have a experience it it. First lets explain the situations: I'm currently working on a big online database project with LAMP. There is a database with about 10 tables, average 15 columns each. This tables contain information about employees in an organization. There will be lots of different reports regarding to this informations. This is fully object oriented based programing in PHP. So, here comes the challenge: is it better to make on simple query to database like : SELECT *, ... FROM some_table INNER JOIN ... and then manipulate data with PHP classes and functions to make reports OR in the other hand making all reports based on complicated query and relay completely on database results? thank you very much in advance. regards, MAMAD Quote Link to comment https://forums.phpfreaks.com/topic/103279-sql-comlicate-querys-vs-php-simple-manipulation/ Share on other sites More sharing options...
dptr1988 Posted April 28, 2008 Share Posted April 28, 2008 If I were you, I would try to do as much as possible with the SQL queries. If you have to use PHP to do SQL work, then you can run item speed and memory issues when you work with large databases. Quote Link to comment https://forums.phpfreaks.com/topic/103279-sql-comlicate-querys-vs-php-simple-manipulation/#findComment-528951 Share on other sites More sharing options...
DyslexicDog Posted April 28, 2008 Share Posted April 28, 2008 I second that notion. Your RDBMS should do as much leg work as possible when dealing with data manipulation. Quote Link to comment https://forums.phpfreaks.com/topic/103279-sql-comlicate-querys-vs-php-simple-manipulation/#findComment-528971 Share on other sites More sharing options...
mamad876 Posted April 28, 2008 Author Share Posted April 28, 2008 OOPS! Thank you very much for such a fast reply. So it seems that I should redo all the work! Regards, MAMAD Quote Link to comment https://forums.phpfreaks.com/topic/103279-sql-comlicate-querys-vs-php-simple-manipulation/#findComment-529041 Share on other sites More sharing options...
mamad876 Posted April 28, 2008 Author Share Posted April 28, 2008 Thank for reply, I've just did a time checking with both ways, almost the same result??? I've just thought you are right with that but the figures are little different!!! Testing execution time with objects: 0.1707 Testing execution time with query: 0.1848 The query prepared to get the same result, as my object oriented system, provides. So any answer? Quote Link to comment https://forums.phpfreaks.com/topic/103279-sql-comlicate-querys-vs-php-simple-manipulation/#findComment-529073 Share on other sites More sharing options...
sasa Posted April 28, 2008 Share Posted April 28, 2008 you have small db Quote Link to comment https://forums.phpfreaks.com/topic/103279-sql-comlicate-querys-vs-php-simple-manipulation/#findComment-529101 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.