Two (Insert & Update)

Download Report

Transcript Two (Insert & Update)

Introduction to
PHP and MySQL
Kirkwood Center for
Continuing Education
By Fred McClurg, [email protected]
© Copyright 2016 All Rights Reserved.
Class Project
Recipe DB Application
Part Two: Insert & Update
http://cecert.kirkwood.edu/~fmcclurg/co
urses/php/slides/recipe02.ppt
Top Level Design
Description: Top level design is a
methodology that addresses the large
picture first and then the details. For
today’s in class project, will apply
that methodology.
General Tasks
Discussion: The items below are the tasks
and the procedure we will follow to
complete the “create.php” application.
0. Create the page layout in HTML.
1. Convert HTML form to PHP.
2. Make form action self-referential.
3. Make the fields “sticky”.
General Tasks (continued 2)
4. Connect, use and close the database (Steps
0, 1, 2 and 6).
5. Create function that populates drop down
list with database values.
6. Determine if a submit button was pressed
and which one.
7. Build the SQL statements for “SELECT”,
“INSERT” and “UPDATE” (Step 3).
General Tasks (continued 3)
8. Output SQL debug statements.
9. Execute SQL statements (Step 4).
10. Obtain results from INSERT.
11. Obtain results from UPDATE.
12. Obtain results from SELECT.
General Tasks (continued 4)
13. Protect SQL from “bad” SQL values.
14. Status message INSERT & UPDATE.
15. Pop-up error dialog messages.
to be continued ...
http://cecert.kirkwood.edu/~fmcclurg/co
urses/php/slides/html5.ppt