Forum Moderators: open
My new web site will be having multiple MySQL queries per web page. As such, I was wondering where I should put the MySQL Connect and MySQL Close statement?
My first thought was to include the connect statement (in the code) right below my main menu (as nothing above that in the code will ever use MySQL). I would then have the close statement located right above the code for the footer.
By doing it this way, it would allow me to standardize the location of the statements while at the same time providing for flexibility in my queries, since the only place I'll be using MySQL is below my main menu and above the footer (code wise).
Would this be acceptable? Or is there another recommendation on where to place the connect/close statements?
Thanks
Jim