ball420 Posted June 18, 2007 Share Posted June 18, 2007 i'm trying to connect to database for the first time and having a little trouble. this is what i have $host= db880.perfora.net; // Host name $username= d; // Mysql username $password= r; // Mysql password $db_name= db20; // Database name $tbl_name= guestbook; // Table name the problem is with the host do i kind of confused as you can see. i have everthing working using wamp and my "localhost"when i upload it to the site folder it won't connect even with the info i was ginin from my webhost. thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/56069-cant-connect-to-db/ Share on other sites More sharing options...
akitchin Posted June 18, 2007 Share Posted June 18, 2007 generally speaking, if you're running the script on your webhost, the MySQL host you use is likely "localhost," but you'll need to change your username and password to match that from your webserver. also note that many shared hosts use your hosting account username as a prefix for database and table names. Quote Link to comment https://forums.phpfreaks.com/topic/56069-cant-connect-to-db/#findComment-276916 Share on other sites More sharing options...
ball420 Posted June 18, 2007 Author Share Posted June 18, 2007 ok i gotcha ya i'm gonna give it a shot let you know in a few Quote Link to comment https://forums.phpfreaks.com/topic/56069-cant-connect-to-db/#findComment-276921 Share on other sites More sharing options...
ball420 Posted June 18, 2007 Author Share Posted June 18, 2007 no luck it's if i need to connect to say my host of db420.perfora.net that would be all i have to put in my host name right i can't put a url because of the // turn it into a comment thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/56069-cant-connect-to-db/#findComment-276929 Share on other sites More sharing options...
akitchin Posted June 18, 2007 Share Posted June 18, 2007 you should be using single quotes to delimit your host, username, password and database - i was under the impression you were omitting them because you were coding freehand. try adding the single quotes and seeing if this helps. Quote Link to comment https://forums.phpfreaks.com/topic/56069-cant-connect-to-db/#findComment-276932 Share on other sites More sharing options...
ball420 Posted June 18, 2007 Author Share Posted June 18, 2007 ya i got the single quotes in there and still no luck!!! i'm lost Quote Link to comment https://forums.phpfreaks.com/topic/56069-cant-connect-to-db/#findComment-276966 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.