I am putting together my server connection file. So I went to the file manager and created a database and a userane and password. What I didnt know was the server name. I found some documentayio on the site and it is....
But when I use localhost fpr the server name I get a response of "not logged in".
ex.
$db_connect=mysql_connect("localhost","my_username", "my_password") or die("not logged in");
//////now selecting our database
$db_select=mysql_select_db("database_name") or die(mysql_error());
What am I doing wrong?
Solved! Go to Solution.
The server name is "localhost" in sql.... i figured it out....here is exactly what you need:
https://www.godaddy.com/help/connecting-to-mysql-using-php-216
Thank You @MrVapor ....
Hey there @codenamejupiter
I'm assuming you know that it has to be in whatever your config file is for your site. Here's what you put in:
/** MySQL database username */ define('DB_USER', 'DBusername'); /** MySQL database password */ define('DB_PASSWORD', 'DBPassword'); /** MySQL hostname */ define('DB_HOST', 'localhost');
You don't put anything after localhost. As long as all the information you have is correct, the database should connect.
Once your issue is resolved,
please be sure to come back and click accept for the solution
Get Better Support on the Community Boards!
Etiquette When Asking for Help from the Community
Thanks for responding MrVapor. But the only way I have ever provided a connection between my files and my server is through a php file working with a sql database. So what i am used to is
So I am not use to using a .config file. Are familiar with sql and php, and if not could you tell me If I create the .config file, or is it already created? Thank You.
The server name is "localhost" in sql.... i figured it out....here is exactly what you need:
https://www.godaddy.com/help/connecting-to-mysql-using-php-216
Thank You @MrVapor ....
Awesome! I'm glad you found your answer and thanks for sharing so the community can benefit as well!
Once your issue is resolved,
please be sure to come back and click accept for the solution
Get Better Support on the Community Boards!
Etiquette When Asking for Help from the Community