stuart7398 Posted March 23, 2008 Share Posted March 23, 2008 hi. throughout my site will be data from a mysql database. 1) do i put the mysql connection on every page? or 2) do i put it somewhere else? 3) where do i put the close connection? is the below an example of what i should be doing? <html> content <mysql connection> data <mysql close> <html> content thanks. Quote Link to comment Share on other sites More sharing options...
mwasif Posted March 25, 2008 Share Posted March 25, 2008 Create a file to create connections and include this file where necessary. This connection can a form of wrapper class or a simple function. Connection is always closed when the page execution is finished (connection created by mysql_connect()). Quote Link to comment Share on other sites More sharing options...
stuart7398 Posted March 25, 2008 Author Share Posted March 25, 2008 hi. thanks. that's what i have been doing. it's nice to get confirmation that something is being doing correctly. thanks again. 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.