Jump to content

Instantiating MySQLi


Fmdpa

Recommended Posts

I'm attempting to deploy my website, finally. I'm working on adjusting it since the server is Linux-based. But the current problem I'm having is not Linux-related. It is the simple problem of instantiating mysqli. Using "http://www.mydomainname.com" doesn't work. I've tried everything I can think of. Can you give me a sample?

$db = new mysqli('host','user','pass','db');

Link to comment
Share on other sites

For more information, the default port of MySQL is 3306. There happens to be a public MySQL database at ensembldb.ensembl.org. To test that connection on Windows, go to Start -> Run and type "cmd". In the prompt, type this:telnet ensembldb.ensembl.org 3306If your firewall allows access, you'll see an answer from MySQL. If that works, try your domain and see if it connects. If it doesn't work your firewall may be blocking traffic on that port.

Link to comment
Share on other sites

Ok, I figured it out and it was much simpler than I expected. When you are hosting a website, I guess the server is set up so that using 'localhost' will select your database. Thanks for your help, JSG!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...