Jump to content

Help with "webhost" in connecting to mysql database


alice123

Recommended Posts

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!

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.