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. Link to comment https://forums.phpfreaks.com/topic/97532-where-do-i-put-mysql-connection/ 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()). Link to comment https://forums.phpfreaks.com/topic/97532-where-do-i-put-mysql-connection/#findComment-500540 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. Link to comment https://forums.phpfreaks.com/topic/97532-where-do-i-put-mysql-connection/#findComment-500570 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.