Connecting MAMP to GoDaddy hosted MySQL database

Bostonaholic

macrumors 6502
Original poster
Aug 21, 2009
439
0
Columbus, Ohio
I've got my website and database hosted by GoDaddy. I just got off the phone with Customer Support and they're unable to give me an answer (I don't believe he understands my problem).

I have my website running through MAMP locally. I want to be able to connect to my hosted database at GoDaddy while I test it locally. Unfortunately, the mysql_connect fails when running locally but if I ftp the files to the GoDaddy hosting, it connects fine.

index.php
PHP:
<?php
...
 require("dbconnect.php");
...
?>
dbconnect.php
PHP:
<?php
//Connect To Database
$hostnmae='<hidden>';
$username='<hidden>';
$password='<hidden>';
$dbname='<hidden>';

mysql_connect($hostname,$username,$password) OR DIE ('Unable to connect to database! Please try again later.');
mysql_select_db($dbname);
?>
Anyone have experience with GoDaddy hosted databases?

Thanks for your help.
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,857
7
USA
$hostname is misspelled. If that was just a typo here only, describe what hostname looks like as that's likely where the issue is.
 

Bostonaholic

macrumors 6502
Original poster
Aug 21, 2009
439
0
Columbus, Ohio
$hostname is misspelled. If that was just a typo here only, describe what hostname looks like as that's likely where the issue is.
SON OF A B*TCH!!!!

Do you know how long this have been bugging me? Thanks. But I wonder why it was able to connect after uploading to the site. Something's screwy.

Anyway, it works. Thanks a lot.


P.S. And the guy at GoDaddy said to "Google it, everyone here doesn't have an answer so we must not support it."
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,857
7
USA
I almost didn't see it either, I looked back to see how you spelled it to make sure I referenced it correctly in my post and that's when I saw the misspelling. Glad that was the extent of the problem.

It's pretty bad your host couldn't help with this. The techy people must have been out sick.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.