Question:
// database credentials
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', 'root');
define('DB_DATABASE', 'real_estate');
// new database connection
$db = new mysqli(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
// check connection
if ($db->connect_errno) {
die("Connection failed: " . $db->connect_errno);
}
after i run it shows like this
Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'root'@'localhost' (using password: NO) in /Applications/AMPPS/www/realestate/inc/config.php on line 9 Connection failed: 1045
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
