AGSperry Posted September 2, 2013 Share Posted September 2, 2013 I am getting an "error connecting to database" messsage. There was no error with the code until I switched to a new hosting server and database. I updated all of the database connect credentials and even tested them with a php database connect test script which worked just fine. Im new to PHP and don't really know how to go about fixing it. You can see the error at thepublicpitate.com/index2.php Any help or assistance is very appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/281767-connection-to-database-error/ Share on other sites More sharing options...
mac_gyver Posted September 2, 2013 Share Posted September 2, 2013 (edited) you would use your database library's error function in your existing error handling logic to get your code to tell you why the query is failing. what database and php database library are you using? also, temporarily setting php's error_reporting to E_ALL and display_errors to ON may help expose why your connection isn't working. Edited September 2, 2013 by mac_gyver Quote Link to comment https://forums.phpfreaks.com/topic/281767-connection-to-database-error/#findComment-1447792 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.