newbie69 Posted November 27, 2007 Share Posted November 27, 2007 I recently developed a simple CMS. Its being working well for a few weeks while testing and developing. But recently my localhost is taking a long time to display the page. My websites consist of the front and and back end which includes _dbconnections.php in _dbconnections i have: function getMysqlResult($sqlStatement){ $user = "csi"; $password = "csi"; $host = "localhost"; $database = "csi2008"; $connection = mysql_connect($host,$user,$password) or die ("could not connect ot the server ".mysql_error()); $db = mysql_select_db($database,$connection) or die (mysql_error()); $result = mysql_query($sqlStatement) or die ("cannot do the query".mysql_error()); return $result; } Each page includes this page as i want to call the function whenever i query the db. I also include the following pages on all pages: include("php_scripts/_miscFunctions.php"); include("php_scripts/_frontendfunctions.php"); The above pages also contains functions, some of which calls the connection function in _dbconnections.php. Can any one advise if this will cause my website to underperform? Thanks alot! Quote Link to comment https://forums.phpfreaks.com/topic/79066-solved-connection-issues-slowing-down-of-localhost-or-website/ Share on other sites More sharing options...
BenInBlack Posted November 27, 2007 Share Posted November 27, 2007 if the function mysql_query() were returning the results in an associative array then close the connection with "mysql_close" Quote Link to comment https://forums.phpfreaks.com/topic/79066-solved-connection-issues-slowing-down-of-localhost-or-website/#findComment-400141 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.