Need assistance connecting My PHP code and MYSQL work on my localhost.
I am running into the following error:
mysqli_connect(): (28000/1045): Access denied for user 'root'@'localhost'
Warning: mysqli_close() expects parameter 1 to be mysqli, boolean given in /Applications/MAMP/htdocs/databases.php on line 22
Here is all the code:
<?php
//create a database connection
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "password";
$dbname = "test";
$connection = mysqli_connect($dbhost,$dbuser,$dbpass,$dbname);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
"http://ift.tt/JknCVP;
<html lang="en">
<head>
<title>Cookies</title>
</head>
<body>
</body>
</html>
<?php
mysqli_close($connection);
?>
Posted On: January 04, 2015 03:45 UTC
ID: 204966662
Category: Web Development > Web Programming
Skills: Array
Country: United States
click to apply
from Online Job Search
I am running into the following error:
mysqli_connect(): (28000/1045): Access denied for user 'root'@'localhost'
Warning: mysqli_close() expects parameter 1 to be mysqli, boolean given in /Applications/MAMP/htdocs/databases.php on line 22
Here is all the code:
<?php
//create a database connection
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "password";
$dbname = "test";
$connection = mysqli_connect($dbhost,$dbuser,$dbpass,$dbname);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
"http://ift.tt/JknCVP;
<html lang="en">
<head>
<title>Cookies</title>
</head>
<body>
</body>
</html>
<?php
mysqli_close($connection);
?>
Posted On: January 04, 2015 03:45 UTC
ID: 204966662
Category: Web Development > Web Programming
Skills: Array
Country: United States
click to apply
from Online Job Search
No comments:
Post a Comment