Connect with other users about what to run on your webhosting (and how to run it) here.
HappyMaskGuy
New to forums
Posts: 3 https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sat May 30, 2020 5:15 am
Post
by HappyMaskGuy » Sun May 31, 2020 8:44 am
Code: Select all
<?php
include(path)
$link=mysqli_connect($host,$username,$password);
@mysqli_select_db($database, $link) or die( "Unable to select database");
If I use Echo it reads the host, username, password and the word "stats" so the path is definitely correct.
Code: Select all
<?php
$host="(host)";
$username="(username)";
$password="(password)";
$database="stats";
?>
I created the "stats" database in the website setting control panel. I used PHPMyAdmin to fill in a few test details.
Any idea why I keep getting the "unable to select database"? Feel like I'm forgetting something very basic.
hiimcody1
Staff
Posts: 1606 Joined: Wed Dec 28, 2011 4:59 pm
Post
by hiimcody1 » Sun May 31, 2020 10:05 am
You'd need to make sure to use the entire name of the database as it is displayed on your Databases tab.
The database would be something like this if you named it "stats":
"username_stats"
HappyMaskGuy
New to forums
Posts: 3 Joined: Sat May 30, 2020 5:15 am
Post
by HappyMaskGuy » Sun May 31, 2020 12:56 pm
I have done that, just didn't want to post username here
hiimcody1
Staff
Posts: 1606 Joined: Wed Dec 28, 2011 4:59 pm
Post
by hiimcody1 » Sun May 31, 2020 1:06 pm
Do you already have a support request open with us by chance? If so, please bump it, otherwise go ahead and open one referencing this forum post so we can take a closer look and verify that there isn't a problem with the database server.