Dynadot

[Resolved] Php post to Mysql

Spaceship Spaceship
Watch
php post to mysql

Im having trouble connecting to my database using the code:

$link = mysql_connect('example.com:3307', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);

Any idea why I cannot connect to the database?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
what is the error message that you receive?

solved via chat. He was using a fully qualified domain instead of localhost when connecting.
 
0
•••
Thanks for the post upon resolution. I hate looking through forums to see someone just say "SOLVED". It doesn't help anyone. These forums are archives for many problems that can be solved if everyone does what you just did.
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back