alice123 Posted April 20, 2008 Share Posted April 20, 2008 Hi everyone, I'm very new to php and am trying to create a registration/login system for my website. I know that I need to be able to connect to my mysql server with a username and password on my site in order to tell it to get to the database and access the information. Right now, I have something like this: "<?php $conn = mysql_connect('localhost', 'username', 'password') or die(mysql_error()); mysql_select_db('users', $conn); ?> <?php" I have no idea what to put under "localhost" that will make it work--I've tried the address to my database (http://p3smysqladmin01.secureserver.net/p41/143/), but I keep getting an error saying that it can't connect to that server. My username and password are correct, so I'm assuming that I'm putting in the wrong server here? What should I put in instead? Thank you! Link to comment https://forums.phpfreaks.com/topic/101993-help-with-webhost-in-connecting-to-mysql-database/ Share on other sites More sharing options...
AndyB Posted April 20, 2008 Share Posted April 20, 2008 localhost is quite often the right name to use. If it doesn't work, ask your web host what to use. Link to comment https://forums.phpfreaks.com/topic/101993-help-with-webhost-in-connecting-to-mysql-database/#findComment-521968 Share on other sites More sharing options...
PFMaBiSmAd Posted April 20, 2008 Share Posted April 20, 2008 The address you posted is just the phpMyAdmin web application. On the screen where you create your database and database user/password, the database server IP address or host name should be listed. If not, you would need to contact your host as they could have any number of database servers and there is no way we could know which one has been assigned to your account. Link to comment https://forums.phpfreaks.com/topic/101993-help-with-webhost-in-connecting-to-mysql-database/#findComment-522020 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.