Click here to Skip to main content
14,875,665 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This is probably a dumb question considering the simplicity of my problem but I can't figure it out anyway.
So my problem is, I am simply trying to connect to my phpmyadmin database. I have done this before successfully but for some reason, this time it is not working. Here is my code:

$con = mysqli_connect("localhost","root","","nz_games");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();

And here the error:
Failed to connect to MySQL: Access denied for user 'root'@'localhost' (using password: NO)

As far as I know there is no password to my database, the default username for phpmyadmin should be root and my table name is nz_games. Please Help!!
Updated 18-Apr-14 14:07pm

1 solution

Try this code

   echo "Successfully connected";

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900