Hello all 🙂
I'm cleaning up the spaghetti code of my project into different functions and includes (there are queries all over the place). I'd like these functions to be independent, so I have each function individually take care of connecting to the database and then closing the connection instead of the parent script. I am concerned though because this could happen several dozen times or more.
I am wondering how taxing this is on the database as opposed to opening one connection and executing all the queries that way. The reason I am breaking it up is because I have several different user levels with different permissions, so different functions will connect with different credentials. Almost all the queries are reading from the database, with very little writing.
Thank you for any insight!