When i try to connect to my sql server, it gives me the error:
Warning: mysqli_connect(): (HY000/1044): Access denied for user ''@'localhost' to database 'dbtest'.
I just created the user and gave it all permissions, but i still dosent work. Before i used another account, but i couldn't change the database perssions for it. Anybody who have a potential fix?
Here is the connect code.
<?php
// this will avoid mysql_connect() deprecation error.
error_reporting( ~E_DEPRECATED & ~E_NOTICE);
// but I strongly suggest you to use PDO or MySQLi.
$DBHOST= "localhost";
$DBUSER= "testadmin";
$DBPASS= "";
$DBNAME= 'dbtest';
$conn = mysqli_connect(localhost, testadmin, $DBPASS, dbtest);
// $dbcon = mysql_select_db($DBNAME);
if ( !$conn ) {
die("Connection failed : " . mysql_error());
}
?>