siric Posted April 28, 2010 Share Posted April 28, 2010 Hi, I am working on a project and have come to a point where I need to run a script that runs a database query and then displays information and I will be calling this from different scripts. Question is would this entail an include or a function? I know that with a function, I have the added capability of passing variables back and forth, but are there any other benefits/detriments to doing it one way over the other? Or do I have it completely wrong?? Thanks Link to comment https://forums.phpfreaks.com/topic/200053-difference-between-function-and-include/ Share on other sites More sharing options...
Ken2k7 Posted April 28, 2010 Share Posted April 28, 2010 Have a class that does the basic work of querying the database and returning results. include or require it on the pages you wish to use. You can also use an autoloader. Link to comment https://forums.phpfreaks.com/topic/200053-difference-between-function-and-include/#findComment-1049977 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.