Only PHP Source
Full Source
Connect to database (procedural):
Three IMPORTANT step on cPanel to create database and connecting:
- Create new database on cPanel. (NOT on phpMyAdmin!)
- Add New User (with password).
- Add User To Database with full privilegs.
Four variables need to connect your database:
- host: "localhost"
- username: "csabaoff_lendoo" cPanel -> MySql Databases -> Current Users (bottom of page): = You created at step 2. above
- password: "myPassword" You created at step 2 above -> If you forget it create another one at Current Users (bottom of page) -> Actions = Change Password
- 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