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 Quote Link to comment 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. Quote Link to comment 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.