In the previous examples, you used the root user to connect to your database and the password was an empty string. Now, replace the username and password with the specified username and passwords above.
- Root user - as in previous examples, the user name was "root" and password was an empty string. Any queries by the root user are allowed full access privileges to all your tables.
$databaseLink = new mysqli("localhost", "root", "", "NeatTreats");
- Customer user - the username is "Customer" and the password is "CustomerPassword123". Only
SELECT
queries on the product table can be made from this database link.
$customerDatabaseLink = new mysqli("localhost", "Customer", "CustomerPassword123", "NeatTreats");
- Admin user - the username is "Admin" and the password is "AdminPassword123". Only
SELECT
,UPDATE
andDELETE
queries on the product table can be made from this database link.
$adminDatabaseLink = new mysqli("localhost", "Admin", "AdminPassword123", "NeatTreats");
Parent topic: Example 3
Top comments (0)