Question: Create/Populate a MySQL Table Add this line to your vars.php file: $PHP_SELF $_SERVER['PHP_ SELF']; Add an associative array ($monthsArray) to your vars.php file that contains


Create/Populate a MySQL TableAdd this line to your vars.php file: $PHP_SELF $_SERVER['PHP_SELF']; Add an associative array ($monthsArray) 

Add this line to your vars.php file: $PHP_SELF $_SERVER['PHP_ SELF']; Add an associative array ($monthsArray) to your vars.php file that contains the monthName => monthDays values for each month. = Execute your displayAssignments () function to display your site navigation. Execute a function from your functions.php file that accepts one parameter ($dateDue) that displays a message under the navigation on your db.php page showing when this assignment is due and how many days are left until it is due (or how many days the assignment is overdue). Create a form with a simple "Create MonthsTable" button. When the user clicks the "Import Months" button, your db.php should: to Connects to your MySQL server. Generates MySQL commands to CREATE a MySQL table, monthsTable, with these fields: monthID INT PRIMARY KEY AUTO_INCREMENT, monthName CHAR(10), monthDays INT (2). Good idea to have your first SQL statement be: DROP TABLE IF EXISTS monthsTable; If the table CREATE command is successful, call a PHP function walks through the $monthsArray and use PHPs to generate MySQL commands to INSERT INTO monthsTable each item in the $monthsArray. Displays a "Successful" or "Unsuccessful" message when complete.

Step by Step Solution

3.44 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Assuming you have already created a MySQL database heres an example of how you can create and popula... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!