Trying to connect to a db with 

```
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
} else {
  echo '.';
}

```

and I get 

```
Connection failed: Access denied for user '*'@'localhost' to database '*'

```

but if I use

```
$conn = mysqli_connect($servername, $username, $password, $dbname);
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
} else {
  echo '.';
}

```

it works! What gives?

I've used new mysqli before in and it worked fine. I know my username/password are right. Its GoDaddy and I clicked all of the permissions. What is going on?

Edit:

Running this:

```
<?php 
ini_set('display_errors',1);
error_reporting(E_ALL);

$servername = "localhost";
$username = "testuser";
$password = "testpassword";
$dbname = "testdb";

mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$conn1 = mysqli_connect($servername, $username, $password, $dbname);
$conn2 = new mysqli($servername, $username, $password, $dbname);
var_dump($conn1->stat, $conn2->stat);

```

Output:

```
Fatal error: Uncaught exception 'mysqli_sql_exception' with message 'Access denied for user 'testuser'@'localhost' to database 'testdb'' in /home/public_html/wj-test.php:11 
Stack trace: 
    #0 /home/public_html/wj-test.php(11): mysqli_connect('localhost', 'testuser', 'testpassword', 'testdb') 
    #1 {main} thrown in /home/public_html/wj-test.php on line 11

```