Configuring a Database
There are two parts to this work. The first part is to create a database and some tables which will be appropriate for the Batty League Flea Market. That portion of the assignment should be completed from the MySQL console command line. The second part of the assignment is to write a PHP script which will display information about the database tables created in the first part and save that information in a file. A complete submission will include both the script - solution07.php - and the text file generated by the script - solution07.txt.
Use the command-line interface to create a new user named "script" for your database. Grant that user all permissions on everything controlled by the DBMS.
Create a database named "fleamarket".
Within that database, create two tables:
The first table should be named "items". Give it three fields:
VARCHAR of length 10 named "itemID"
FLOAT named "itemPrice"
VARCHAR of length 30 named "description"
The second table should be named "sales". Give it five fields:
VARCHAR of length 10 named "itemID"
FLOAT named "itemPrice"
VARCHAR of length 10 named "firstName"
VARCHAR of length 10 named "lastName"
DATE named "purchaseDate"
Create a script file named solution07.php. Within that script, connect to your DBMS using the "script" identity. Select the "fleamarket" database, then obtain a listing of the tables.
Use the file-creation techniques we learned in previous classes to save the results of your queries into a file named solution07.txt.
Submit both solution07.php and solution07.txt.