I need to connect to a database on godaddy and insert some values. All the code is in place and it works on localhost. However I do not know how to connect to the online database. I chose the remote hosting option while creating the database on their web interface.
It does not work with localhost as apparently they are not hosted on the same server.
Specifically what I need to know is what I need to write into this.
$con = mysql_connect("WHATINEEDTOWRITE","username","password");
//note that mysql_connect is just given as an example to help clarify the situation.
Thank you.
GoDaddy runs their database servers off a remote host.
Thus, your $con statement will look similar to the following:
$con = mysql_connect("USERNAME.db.123456789.hostedresource.com", "DATABASE_USERNAME", "DATABASE_PASSWORD");You would then select the database in a following statement.
Good luck!