Part 1: Make the connection • Write a PHP file that database can be added to other PHP files using the include or requir

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Part 1: Make the connection • Write a PHP file that database can be added to other PHP files using the include or requir

Post by answerhappygod »

Part 1: Make the connection • Write a PHP file that database canbe added to other PHP files using the include or require functions.• This file should: ▪ Make a connection to a MySQL database, andlog in with valid credentials. The connection resource should bestored in a variable with an appropriate name. ▪ Create a databasecalled Major if it does not exist. ▪ Select theMajor database. ▪ Create a table called Users if it does notexist with the following fields: o USERNAME VARCHAR (100) oPASSWORD VARCHAR (40) o PHONE VARCHAR (10) o EMAIL VARCHAR (50) oUSERTYPE INT ▪ The USERNAME field should be designated as UNIQUE. ▪If any of these operations cause an error, stop execution and printthe error message ▪ For USERTYPE, 1 represents the admin user and 2represents a regular user. ▪ Create a table called Tasks if doesnot exist with the following fields: o TASKID AUTO NUMBER oTASKTYPE VARCHAR(50) o TASKDESCRIPTION VARCHAR(200) o ASSIGNEDTOINT o COMPLETED VARCHAR(1)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply