Solarpitch Posted November 7, 2006 Share Posted November 7, 2006 Hey,Is it a good idea to have all of your database code, functions and what not in one Master php file which is used buy all pages in your site to access for querys and calculations. So in all the other pages you just include the "Master.php" file and reference the function in that Master page, pass information to it and return calculations and querys? Link to comment https://forums.phpfreaks.com/topic/26495-quick-web-structure-question/ Share on other sites More sharing options...
trq Posted November 7, 2006 Share Posted November 7, 2006 If it makes things easier. Link to comment https://forums.phpfreaks.com/topic/26495-quick-web-structure-question/#findComment-121191 Share on other sites More sharing options...
blear Posted November 7, 2006 Share Posted November 7, 2006 It doesnt make a whole lot of difference. PhP code is executed server side, so the end user cant see the code anyways. Also, having one huge file makes every page a burden on the system, as it has to load the entirety of all the code every time a new page is loaded.The rest is just a matter of you, the developer, navigating one monstrous .php file. Link to comment https://forums.phpfreaks.com/topic/26495-quick-web-structure-question/#findComment-121194 Share on other sites More sharing options...
Solarpitch Posted November 7, 2006 Author Share Posted November 7, 2006 So If I had 10 different pages . . would it be better to have the the sql query and function at the start of each page rather than having seperate functions located in a monster php file? Link to comment https://forums.phpfreaks.com/topic/26495-quick-web-structure-question/#findComment-121198 Share on other sites More sharing options...
Solarpitch Posted November 7, 2006 Author Share Posted November 7, 2006 I suppose I could break the Master php file into 4 or 5 mini "master" files grouping related functions and procedures together. ie . . have one that handles database querys . . another one that does calculations and if statements etc? Link to comment https://forums.phpfreaks.com/topic/26495-quick-web-structure-question/#findComment-121201 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.