By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,405 Members | 1,531 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,405 IT Pros & Developers. It's quick & easy.

Cannot connect to localhost using GoDaddy

P: n/a
I'm (trying) to help a friend setup a MySQL db and use some simple
scripts on a site hosted with GoDaddy. I note that GoDaddy appears to
use Microsoft. I have done this:

$connection = mysql_connect("localhost","mydatabase","password")
or die ("Couldn't connect to server.");
$sql = mysql_query("SELECT * FROM dummy");
$row = mysql_fetch_array($sql);
echo $row['name'];
?>

on several Apache servers and it always seems to work. I created the
MySQL database using the GoDaddy control panel (which is very confusing
and poor IMO). I dove into phpAdmin and was able to do stuff. But I
can't get php to connect.

Is there something different I need to do for Microsoft servers?

Thanks,

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Dale wrote:
I'm (trying) to help a friend setup a MySQL db and use some simple
scripts on a site hosted with GoDaddy. I note that GoDaddy appears to
use Microsoft. I have done this:

$connection = mysql_connect("localhost","mydatabase","password")
or die ("Couldn't connect to server.");
$sql = mysql_query("SELECT * FROM dummy");
$row = mysql_fetch_array($sql);
echo $row['name'];
?>

on several Apache servers and it always seems to work. I created the
MySQL database using the GoDaddy control panel (which is very confusing
and poor IMO). I dove into phpAdmin and was able to do stuff. But I
can't get php to connect.

Is there something different I need to do for Microsoft servers?

Thanks,


Did you ask GoDaddy? The database may not be on your host. Check their
documentation.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 17 '05 #2

P: n/a
>I'm (trying) to help a friend setup a MySQL db and use some simple
scripts on a site hosted with GoDaddy. I note that GoDaddy appears to
use Microsoft. I have done this:

$connection = mysql_connect("localhost","mydatabase","password")
The second parameter to mysql_connect is a user name, not a database
name. Depending on how hosting companies assign these things, this
may not make any difference. Also, sometimes the host name that
works is the host name of the machine, NOT localhost (even if they
are the same machine), due to permissions setup. And sometimes the
database has its own machine.
or die ("Couldn't connect to server.");
$sql = mysql_query("SELECT * FROM dummy");
$row = mysql_fetch_array($sql);
echo $row['name'];
?>

on several Apache servers and it always seems to work. I created the
MySQL database using the GoDaddy control panel (which is very confusing
and poor IMO). I dove into phpAdmin and was able to do stuff. But I
can't get php to connect.

Is there something different I need to do for Microsoft servers?


I think you need to ask GoDaddy.

Gordon L. Burditt
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.