webdevdea Posted November 13, 2013 Share Posted November 13, 2013 I am in the process of learning.. I am working on some code from my book trying to get my database connected and I must have something mixed up somewhere THIS IS THE CODE I AM REPLACING IT WITH( i have used anonymous usernames and passwords and such) $connect = mysql_connect("localhost","user","password") or die ("Could not connect."); mysql_select_db("databasename") or die ("Could not find database"); $dbname='databasename'; ?> code from book $connect = mysql_connect("mapswidgetsusers.db.3618229.hostedresource.com","mapswidgetsusers","MtM2008yG5") or die ("Could not connect."); mysql_select_db("mapswidgetsusers") or die ("Could not find database"); $dbname='mapwidgetsusers'; ?> Link to comment https://forums.phpfreaks.com/topic/283863-connection-error/ Share on other sites More sharing options...
Ch0cu3r Posted November 13, 2013 Share Posted November 13, 2013 So what is the question/problem? Link to comment https://forums.phpfreaks.com/topic/283863-connection-error/#findComment-1458117 Share on other sites More sharing options...
webdevdea Posted November 13, 2013 Author Share Posted November 13, 2013 I cannot get it to connect.. something in my code is wrong I do not know if I am putting the database where the username should be or something like that .. I tried it a few different ways and cannot get it to connect Link to comment https://forums.phpfreaks.com/topic/283863-connection-error/#findComment-1458143 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.