Suggested articles for you:

57 thoughts on “Complete Login and Registration Application using PHP and MySQL

      1. blankAnvesh

        Warning: mysqli_connect(): (HY000/1049): Unknown database ‘loginsystem’ in C:\wamp64\www\anvesh\includes\dbh.inc.php on line 8

        Reply
        1. blankRavi Bandakkanavar Post author

          Hi,

          Its failing at $conn = mysqli_connect($serverName, $dBUsername, $dBPassword, $dBName, 3306);
          Do verify your MySQL server’s credentials.

  1. blankYushiko

    Warning: mysqli_connect(): (HY000/1045): Access denied for user ‘root’@’localhost’ (using password: YES) in C:\xampp\htdocs\Complete-Login-and-Registration\includes\dbh.inc.php on line 8
    Connection failed: Access denied for user ‘root’@’localhost’ (using password: YES)

    what do i change in the code?

    Reply
    1. blankRavi Bandakkanavar Post author

      Hi Yushiko,

      What is the username and password for your MySQL application? You need to add the same details in the connection string.

      Reply
  2. blankrakshitha

    hi
    I am getting following error

    *website error. contact admint to have it fixed

    could you please help me

    Reply
    1. blankRavi Bandakkanavar Post author

      Hi Rakshitha,

      As you can see in the code, this error is thrown when SQL exception is raised. You have to verify the MySQL server’s credentials and database name. It should work after that.

      Reply
        1. blankRavi Bandakkanavar Post author

          Hi Saeed,

          What database server are you using? Can you provide the username and password used for your database server?

      1. blanksam

        hi i am too getting the same error after clicking submit on signup form. could u help me out here

        Reply
  3. blankFred

    Thanks for these great script. Bravo.
    I got the following error when i click on the edit profile button:

    Notice: Use of undefined constant TITLE – assumed ‘TITLE’ in C:\xampp\htdocs\loginsystem\edit-profile.php on line 2

    Reply
    1. blankRavi Bandakkanavar Post author

      Hi Fred,

      Sorry about that. Could you please try commenting the second line. The following line

      define(TITLE, “Edit Profile”);

      Reply
  4. blankDarryl Santmayor

    Hey im getting an error “Warning: mysqli_connect(): (HY000/1045): Access denied for user ‘root’@’localhost’ (using password: NO) in C:\xampp\htdocs\log\includes\dbh.inc.php on line 8
    Connection failed: Access denied for user ‘root’@’localhost’ (using password: NO)”

    I created loginsystem database but can u give the sql code for table creation.

    Reply
    1. blankRavi Bandakkanavar Post author

      Hi Darryl,

      Where are you executing this one?
      Please make the following change in dbh.inc.php and try.

      $dBPassword = “”; //Database password

      Reply

Did it help? Would you like to express?