Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, © Copyright 2010 All Rights Reserved.

Similar presentations


Presentation on theme: "Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, © Copyright 2010 All Rights Reserved."— Presentation transcript:

1 Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, frmcclurg@gmail.com © Copyright 2010 All Rights Reserved.

2 Class Project Recipe DB Application Part One: Search & Delete http://webcert.kirkwood.edu/~fmccl urg/courses/php/slides/recipe01.ppt

3 Description: The first step of any project is to define the requirements. 1. Provide a web interface to the notecard database. 2. Make sure that the user can perform CRUD operations on the data. 3.Function is more important than esthetics. For this project, we pick “fast” and “cheap”. Requirements Definition Good Fast Cheap

4 Review: An understanding of the database schema is important. 1.To rapidly create database and test data, import “cookbookDB.sql” or create the following database from scratch. Database Requirements

5 Description: It is pretty hard to beat pencil and paper for rapidly laying out ideas. The original sketch can be refined using “visio”, “dia”, “xfig”, or “OpenOffice Draw”. The form controls can also be captured as images to be pasted and arranged in any graphics application. (see “webParts.html”) Interface Design

6 TitleRecipeCategoryDelete? JelloMix...Dessert PuddingMix...Dessert KoolaidMix...Beverage... Sketch of interface that handles the “R” and “D” of CRUD: Interface Design Search Delete Selected

7 TitleRecipeCategoryDelete JelloMix...Dessert PuddingMix...Dessert KoolaidMix...Beverage... Alternate sketch of GUI interface that handles the “R” and “D” of CRUD: Interface Design Search Delete

8 Sketch of GUI interface that handles the “C” and “U” of CRUD: Interface Design Mix Cocoa packet with water. Heat. Stir. Hot Cocoa Create Modify Beverage

9 Discussion: The following procedure represents the tasks we will follow to complete the “search.php” application. 0.Convert from HTML to PHP. 1.Perform the following tasks: a.Initialize variables (Step 0) b.Connect to database (Step 1) c.Use a database (Step 2) d.Close the database connection (Steps 6). General Tasks

10 Discussion: The following procedure represents the tasks we will follow to complete the “search.php” application. 2.Perform the following tasks : a.Build the SQL “SELECT” statement (Step 3). b.Execute the SQL statement (Step 4). 3.Build a SQL debug statement. 4.Build a HTML table with database data: b.Obtain results from “SELECT” statement (Step 5) c.Display data in dynamic HTML table. General Tasks

11 5.Remove the static HTML table. 6.Make form changes: a.Make form self-referential (action flexibility). b.Make text field “sticky” (remember previous state). 7.Populate drop-down list with DB values. General Tasks (cont. 2)

12 8.Add search capabilities for title. 9.Add search capabilities for category. 10.Add search capabilities for content. 11.Make checkboxes “sticky”. 12.Separate CSS into a separate file. 13.Separate JavaScript into separate file. General Tasks (cont. 3)

13 Discussion: The items below are the tasks and the procedure we will follow to complete the “delete.php” application. 14.Perform the following tasks: a.Connect and use the database (Steps 1 & 2). b.Build the SQL “DELETE” statement (Step 3). c.Execute the SQL statement (Step 4). d.Obtain results from “DELETE” statement (Step 5). General Tasks (cont. 4)

14 to be continued... http://webcert.kirkwood.edu/~fmccl urg/courses/php/slides/recipe02.ppt


Download ppt "Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, © Copyright 2010 All Rights Reserved."

Similar presentations


Ads by Google