Mr.Canuck Posted May 27, 2010 Share Posted May 27, 2010 I am getting this error when I try and view my CMS. Warning: mysql_pconnect() [function.mysql-pconnect]: Unknown MySQL server host 'MYSQLHOST' (1) in/home/neatspac/public_html/cms/includes/classes/MySQL.handler.class.php on line 100 The issue is that it is looking for MYSQLHOST and it needs to be LOCALHOST. I just don't know how to change it to look for localhost in the MySQL.handler.class.php file on line 100 below: if($this->connection = ($bPersistant ? mysql_pconnect($sHost, $sUser, $sPassword) : mysql_connect($sHost, $sUser, $sPassword))) { $this->setConnected(TRUE); How do I make it "localhost" in this snippet of code? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/203108-change-to-localhost/ Share on other sites More sharing options...
Maq Posted May 27, 2010 Share Posted May 27, 2010 Where is $sHost defined? Quote Link to comment https://forums.phpfreaks.com/topic/203108-change-to-localhost/#findComment-1064208 Share on other sites More sharing options...
Mr.Canuck Posted May 27, 2010 Author Share Posted May 27, 2010 Thanks for the reply. I will have to try and find out where $sHost is defined (then I could just change it to localhost) correct?? Also, what is that snippet of code you put in your last post? I don't know what I should do with that. I am a SQL novice (obviously). Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/203108-change-to-localhost/#findComment-1064213 Share on other sites More sharing options...
Mr.Canuck Posted May 27, 2010 Author Share Posted May 27, 2010 Could I not just replace $sHOST with localhost like this: if($this->connection = ($bPersistant ? mysql_pconnect(localhost, $sUser, $sPassword) : mysql_connect(localhost, $sUser, $sPassword))) { $this->setConnected(TRUE); Quote Link to comment https://forums.phpfreaks.com/topic/203108-change-to-localhost/#findComment-1064223 Share on other sites More sharing options...
Mr.Canuck Posted May 27, 2010 Author Share Posted May 27, 2010 I just had to locate the config.php file and change the host to "localhost" in there. Problem solved. Quote Link to comment https://forums.phpfreaks.com/topic/203108-change-to-localhost/#findComment-1064227 Share on other sites More sharing options...
Maq Posted May 27, 2010 Share Posted May 27, 2010 Could I not just replace $sHOST with localhost like this: if($this->connection = ($bPersistant ? mysql_pconnect(localhost, $sUser, $sPassword) : mysql_connect(localhost, $sUser, $sPassword))) { $this->setConnected(TRUE); Yeah, but that would only fix it for that file. If '$bHost' is used anywhere else it won't work. I just had to locate the config.php file and change the host to "localhost" in there. Problem solved. Nice, I figured there was some sort of configuration file being included. Quote Link to comment https://forums.phpfreaks.com/topic/203108-change-to-localhost/#findComment-1064263 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.