<?php
// database credentials
define(‘DB_SERVER’, ‘localhost’);
define(‘DB_USERNAME’, ‘root’);
define(‘DB_PASSWORD’, ‘root’);
define(‘DB_DATABASE’, ‘real_estate’);
// new database connection
$db = newmysqli(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): Accessdenied for user ‘root’@’localhost’ (using password: NO) in/Applications/AMPPS/www/realestate/inc/config.phpon line 9
Connection failed: 1045
Expert Answer
An answer will be send to you shortly. . . . .