raryre23 Posted April 9, 2007 Share Posted April 9, 2007 i am new to php and have downloaded some script. the instructions told me only to edit this bit to connect it to a mysql database: $dbServer = "h41mysql19.secureserver.net"; $dbuserName = "kaikohe2"; $dbpassword = "**********"; $dbName ="kaikohe2"; i really dont know where ive gone wrong? whenever i try and anything that uses the script it says "cannot find database". my website is hosted on godaddy and i have made databases using both versions 4.1 and 5.0 to see if i makes a difference. any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/46336-solved-a-simple-question/ Share on other sites More sharing options...
wildteen88 Posted April 9, 2007 Share Posted April 9, 2007 Are the database credentials you are using correct? Are the ones godaddy supplied when you got your hosting account? $dbServer = "h41mysql19.secureserver.net"; The line above should be the mysql servers hostname. If you don't know it localhost should do $dbuserName = "kaikohe2"; The line above is the username for connecting to the MySQL server $dbpassword = "**********"; The line above is the database for the username supplied above $dbName ="kaikohe2"; The line above is for your the database you wish to use. Quote Link to comment https://forums.phpfreaks.com/topic/46336-solved-a-simple-question/#findComment-225433 Share on other sites More sharing options...
raryre23 Posted April 9, 2007 Author Share Posted April 9, 2007 nope thats all correct!! i tried changing it to localhost but same problem! Quote Link to comment https://forums.phpfreaks.com/topic/46336-solved-a-simple-question/#findComment-225435 Share on other sites More sharing options...
boo_lolly Posted April 9, 2007 Share Posted April 9, 2007 what query are you using to connect to the database? it is not only important to have the correct parameters, but also to make sure they are embedded in the correct manner in the correct functions. also, have you tried logging in and selecting the database from the command line? Quote Link to comment https://forums.phpfreaks.com/topic/46336-solved-a-simple-question/#findComment-225436 Share on other sites More sharing options...
raryre23 Posted April 9, 2007 Author Share Posted April 9, 2007 forgive my ignorance but i really am a beginner at this.........selecting the database from the command line? there are lots of different php scripts but according to the instructions the one called config.php is the only one i am meant to change. The whole of config.php goes like this: <? $dbServer = "localhost:3306"; $dbuserName = "kaikohe2"; $dbpassword = "******"; $dbName ="kaikohe2"; ///////////////////// DO NOY EDIT BELOW ///////////////////////////////////////// $con=mysql_connect ($dbServer, $dbuserName, $dbpassword) or die ('Cannot connect to the database.'); $db=mysql_select_db ($dbName); session_start(); I dont know if thats anymore helpful? Quote Link to comment https://forums.phpfreaks.com/topic/46336-solved-a-simple-question/#findComment-225442 Share on other sites More sharing options...
hackerkts Posted April 9, 2007 Share Posted April 9, 2007 Don't put port after your localhost, just put localhost. Quote Link to comment https://forums.phpfreaks.com/topic/46336-solved-a-simple-question/#findComment-225445 Share on other sites More sharing options...
raryre23 Posted April 9, 2007 Author Share Posted April 9, 2007 no change without the port! Quote Link to comment https://forums.phpfreaks.com/topic/46336-solved-a-simple-question/#findComment-225448 Share on other sites More sharing options...
hackerkts Posted April 9, 2007 Share Posted April 9, 2007 no change without the port! Sorry, I don't understand what you mean. But for this $dbServer = "localhost:3306"; You just have put $dbServer = "localhost"; P.S: Please double check that your server, username, password and database are correct. Quote Link to comment https://forums.phpfreaks.com/topic/46336-solved-a-simple-question/#findComment-225451 Share on other sites More sharing options...
raryre23 Posted April 9, 2007 Author Share Posted April 9, 2007 it doesnt make a difference when i change it to just "localhost".....thats what i meant by no change without the port! ive logged in to my database with username and password so im guessing they are right....the only things left to be wrong are the dbserver and dbname........but im pretty sure they are right.... Quote Link to comment https://forums.phpfreaks.com/topic/46336-solved-a-simple-question/#findComment-225453 Share on other sites More sharing options...
raryre23 Posted April 10, 2007 Author Share Posted April 10, 2007 could it perhaps be some limitations on my hosting account that is causing the problems?? i am on godaddy economy hosting..? Quote Link to comment https://forums.phpfreaks.com/topic/46336-solved-a-simple-question/#findComment-225492 Share on other sites More sharing options...
boo_lolly Posted April 10, 2007 Share Posted April 10, 2007 could it perhaps be some limitations on my hosting account that is causing the problems?? i am on godaddy economy hosting..? economy hosting i would imagine is a relatively secure server. you may want to contact your hosting company and ask to speak with a level 2 technician. Quote Link to comment https://forums.phpfreaks.com/topic/46336-solved-a-simple-question/#findComment-225568 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.