Only PHP Source Full Source

Connect to database (procedural):

Three IMPORTANT step on cPanel to create database and connecting:

  1. Create new database on cPanel. (NOT on phpMyAdmin!)
  2. Add New User (with password).
  3. Add User To Database with full privilegs.

Four variables need to connect your database:

  1. host: "localhost"
  2. username: "csabaoff_lendoo" cPanel -> MySql Databases -> Current Users (bottom of page): = You created at step 2. above
  3. password: "myPassword" You created at step 2 above -> If you forget it create another one at Current Users (bottom of page) -> Actions = Change Password
  4. name of database: "csabaoff_users" You find the name at 3. section on the page: Current Databases
ERROR: Unable to connect to the csabaoff_users database:
Access denied for user 'csabaoff_lendoo'@'localhost' (using password: YES)
Error number: 1045
File: /home/cselkoof/domains/cselko.offyoucode.co.uk/public_html/tutorial/The Complete Web Development Course/7. mySQL/1. introduction.php
Line: 67