On This Page
Overview
During this assignment, you will:
- Allow a user to query your project database
- Create a report based on the query
- Use arrays to extract data from a result set
Note that you should keep your forms and form processing simple for this assignment. We will be talking about how to organize complicated forms in lesson 9.
^ top
Specifications
This assignment has several parts:
- Create an input page for your project that allows a user to query your project database.
The user in this case may be an administrator or an anonymous user. You can use simple hyperlinks or more complex form elements for the input page.
- Create a PHP script that processes the input data to perform the following:
- Makes a SELECT query on your database
- Uses one or more of the following functions to get data into an array:
- Displays the array data in an HTML table
- Export your database as SQL statements to a dbname.
sql file.
Name the file after your database and add the extension .sql to the name. Make sure your tables are in a loadable order. You may need to arrange your table order manually, so test your dbname.sql file before submitting it.
Make sure of the following about your dbname.sql file:
- Does not contain a SQL 'USE' or 'CREATE DATABASE' statement
- Includes
DROP TABLE IF EXISTS statements for all tables
- Is compatiable with MySQL version 4.0.X
Note that phpMyAdmin supports all these behaviors if you check the correct checkboxes.
Additional specifications are:
- The name of the page that reports data from the database must be called
report.php.
Using the specified name makes grading easier. After you turn in the assignment, you can change the name of the page for your final project.
- Your PHP code must use the included file
includes/dbconvars.php for all database connection arguments. Even though you do not need to submit your dbconvars.php file, the instructor will need to use it to test your work. If you do not use dbconvars.php, you will receive a poor grade.
- Create a PHP comment at the top of all PHP pages formatted like the following:
/**
* CIS-165PH Asn 8
* query.php
* Purpose: Report page for Ask Artzy!
*
* @author Ed Parrish
* @version 1.1 04/04/04
*/
- In your README.txt file provide instructions on using this assignment. For example, if a password is required, please include a password. If any values are required for a form, please provide the values.
- Place at least the following files in the web-application root directory:
README.txt file
report.php file
- dbname.
sql file
- Zip your project and all files and subdirectories you plan to submit using a zip utility such as WinZip or the Linux zip utility.
The zip file must extract into a directory that the instructor chooses. Do NOT use absolute (full) paths. Failure to comply with this instruction may result in a special grade of one point for the assignment.
Sample Operation
You can view an example of a report and query operation called Show Artzy! Note that you are free to implement any type of report and query operation and do not need to follow this example.
^ top
Extra Credit
The following are worth extra credit points:
- Combine the query and report script within one page named
report.php. A useful function for this is isset. See Combining HTML and PHP Code on a Single Page for more information. (2 points)
- Read ahead in the textbook and use programmer-defined functions to organize your code. (1 point)
- Restrict the queries that a user can make. Describe your technique in your README.txt file. (1-2 points)
Make certain that your README.txt file lists any extra credit attempted.
^ top
Grading Criteria
The instructor will evaluate your assignment using the following criteria. Each criteria represents a specific achievement of your assignment and has a scoring guide. The scoring guide explains the possible scores you can receive.
Some scoring guides have a list of indicators. These indicators are a sign of meeting, or a symptom of not meeting, the specific criterion. Note that a single indicator may not always be reliable or appropriate in a given context. However, as a group, they show the condition of meeting the criterion.
For information on grading policies, including interpretation of scores, see the course Syllabus.
Database Export
- 2: Database loads from dbname.
sql file with no errors or warnings
- 1: Database loads from dbname.
sql file but has errors, warnings or missing data
- 0: Does not load or dbname.
sql file not submitted
PHP Functionality
- 10: Demonstrates mastery of the assignment
- Has extra features or demonstrates techniques beyond the assignment
- Applies concepts from the lesson(s) appropriately
- Meets all specifications (see above) with particularly elegant solutions
- No errors encountered during operation
- 8: Has all the functionality expected of the assignment
- Demonstrates many techniques from the lesson
- Meets all specifications (see above)
- Implementation seems more complicated than necessary.
- May have one minor error
- 6: Has most of the functionality expected of the assignment
- Demonstrates some techniques from the lesson
- Meets all but one of the specifications (see above)
- Implementation seems excessively complicated.
- May have 2-3 minor errors
- 4: Has some of the functionality expected of the assignment
- Demonstrates some techniques from the lesson
- Meets at least 1/2 of the specifications (see above)
- Implementation seems excessively complicated.
- May have more than 3 minor errors
- 2: Serious functional problems but shows some effort and understanding
- Meets less than 1/2 of the of the specifications (see above)
- Has a major error or many minor errors
- Implementation seems very convoluted
- Demonstrates few techniques from the lesson
- 0: Does not execute
HTML Code
- 4: Demonstrates mastery of HTML
- Has extra features or demonstrates techniques beyond the assignment
- Meets all specifications (see above) with particularly elegant solutions
- No errors in the HTML code (both opening and closing tags used)
- 3: Has most of the functionality expected of the assignment
- Demonstrates many techniques from the lesson
- Meets all specifications (see above)
- May have 1-2 minor HTML errors.
- 2: Has some of the functionality expected of the assignment
- Demonstrates some techniques from the lesson
- Meets some of the specifications (see above)
- May have 4-5 minor errors
- 1: Serious problems but shows some effort and understanding
- Demonstrates few techniques from the lesson
- Meets few of the of the specifications (see above)
- Has many errors
- 0: No HTML file submitted or page does not display anything
PHP Documentation
- 2: Code is well-documented
- Name, date, and page description in page comment block
- Follows format for page comment block
- Proper use of whitespace and indenting
- 1: Code has some documentation errors
- 0: No apparent attempt at documentation
README.txt File
- 2: README.txt file submitted with specified information included
- 1: README.txt submitted but some information was not included
- 0: No README.txt submitted
Maximum Score: 20, plus extra credit
^ top
What to Turn In
Submit a zipped file with all required files in the specified directories following the instructions for homework. Your .zip file must include all the files and subdirectories needed to make your assignment function properly. Do not assume that the instructors has any files except dbconvars.php. Your assignment must work as submitted.
^ top
Home
| WebCT
| Announcements
| Course info
| Expectations
| Schedule
Project
| Help
| FAQ's
| HowTo's
| Links
Last Updated: April 18 2006 @17:28:23
|