Connecting Tech Pros Worldwide Help | Site Map

Cannot connect to localhost using GoDaddy

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 01:29 PM
Dale
Guest
 
Posts: n/a
Default Cannot connect to localhost using GoDaddy

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,


  #2  
Old July 17th, 2005, 01:29 PM
Jerry Stuckle
Guest
 
Posts: n/a
Default Re: Cannot connect to localhost using GoDaddy

Dale wrote:[color=blue]
> 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,
>[/color]

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.
jstucklex@attglobal.net
==================
  #3  
Old July 17th, 2005, 01:29 PM
Gordon Burditt
Guest
 
Posts: n/a
Default Re: Cannot connect to localhost using GoDaddy

>I'm (trying) to help a friend setup a MySQL db and use some simple[color=blue]
>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")[/color]

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.
[color=blue]
> 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?[/color]

I think you need to ask GoDaddy.

Gordon L. Burditt
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.