kosstr12 Posted February 14, 2008 Share Posted February 14, 2008 I'm not very fluent in PHP so i decided to get a login tutorial off the internet, and I'm stuck on one part, finding my database name...here is the code i need to insert it into: <? // Replace the variable values below // with your specific database information. $host = "localhost"; $user = "UserName"; $pass = "Password"; $db = "dbName"; // This part sets up the connection to the // database (so you don't need to reopen the connection // again on the same page). $ms = mysql_pconnect($host, $user, $pass); if ( !$ms ) { echo "Error connecting to database.\n"; } // Then you need to make sure the database you want // is selected. mysql_select_db($db); ?> Link to comment https://forums.phpfreaks.com/topic/91062-help-with-finding-database-name/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 14, 2008 Share Posted February 14, 2008 Databases are usually created by you, therefore you know the name, rather than the other way around. However, a lot a web hosting companies only give you one database and they pre-create it with a specific name for your account. If this is the case, the database name should be available somewhere within the account information given to you or it should be displayed somewhere in your hosting account control panel (typically in a database section.) Link to comment https://forums.phpfreaks.com/topic/91062-help-with-finding-database-name/#findComment-466725 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.