I'm not sure if this has been mentioned or not before, and after a search I couldn't find it, also checking out that better php programming sticky didn't answer the question either.
Anyway... I've always wondered if it was really bad to connect to a mysql database, have it process a query, return the results, mysql_close that connection, and then open it up again and repeate the process.
Is it horrible to open up the same database connection multiple times, and if so how bad is it? I use include files to include a navigation for example, and in that nav I use mysql to retrieve the nav items, but outside of the nav, I also connect to the mysql database a few times per page and query it.
Any information on this would be great, thanks.
Anyway... I've always wondered if it was really bad to connect to a mysql database, have it process a query, return the results, mysql_close that connection, and then open it up again and repeate the process.
Is it horrible to open up the same database connection multiple times, and if so how bad is it? I use include files to include a navigation for example, and in that nav I use mysql to retrieve the nav items, but outside of the nav, I also connect to the mysql database a few times per page and query it.
Any information on this would be great, thanks.
