U:/msu/course/cse/103 Day 25, Slide 1 Back-up PHP Files If you have not yet passed the 3.0 BT, make back-up copies of ALL.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

1 CSE Students: Please do not log in yet. Check-in with Brian in the back. Review Days 3 and 4 in the book. Others: Please save your work and logout.
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
U:/msu/course/cse/103 Day 23, Slide 1 Review of Day 22 What query did you use to search for an actor by name? –Return matches.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
PHP Scripts HTML Forms Two-tier Software Architecture PHP Tools.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Figure 1. Hit analysis in 2002 of database-driven web applications Hits by Category in 2002 N = 73,873 Results Reporting 27% GME 26% Research 20% Bed Availability.
MBAC 611.  We have been using MS Access to query and modify our databases.  MS Access provides a GUI (Graphical User Interface) that hides much of the.
PHP and SQL Server: Queries IST2101. Project Report 4 SQL Queries Due Sunday, 4/5 at 11:59pm Instructions on how to access team webspace and SQL database.
ACCESS 2007 ASSIGNMENT SPRING 2014 Purpose: To give students a basic understanding of ACCESS 2007 by constructing a database using the Ready2Read bookstore.
MS Access: Database Concepts Instructor: Vicki Weidler.
Department of Information Technology e-Michigan Web Development 0 HTML Form Creation in the Vignette Content Management Application.
MIS 3200 – Unit 6.2 Learning Objectives How to move data between pages – Using Query Strings How to control errors on web pages – Using Try-catch.
1 MySQL and phpMyAdmin. 2 Navigate to and log on (username: pmadmin)
U:/msu/course/cse/103 Day 10, Slide 1 CSE 103 Students: Your BTs have been graded. See Erica or Jo with questions or stay.
U:/msu/course/cse/103 Day 04, Slide 1 CSE students: Do not log in yet. Computers are SLOW today! Review days 13.
PHP meets MySQL.
Exploring Microsoft Access Chapter 4 Relational Databases, External Data, Charts, and the Switchboard.
10 May Microsoft Access 2010 Relational databases’ program Part of the Microsoft Office package Administer relational database Update database through.
_______________________________________________________________________________________________________________ PHP Bible, 2 nd Edition1  Wiley and the.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
SYST Web Technologies SYST Web Technologies Databases & MySQL.
Week 7. Lecture 2 Functions, Arrays, PHP&MySQL. Function with More than one argument and a return statement For a function to return a value, the return.
Microsoft Office 2007 Access Chapter 6 Using Macros, Switchboards, PivotTables, and PivotCharts.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
NMD202 Web Scripting Week3. What we will cover today Includes Exercises PHP Forms Exercises Server side validation Exercises.
Chapter 17 Creating a Database.
U:/msu/course/cse/103 Day 06, Slide 1 CSE students: Do not log in yet. Review Day 6 in your textbook. Think about.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Office Management Tools II Ms Saima Gul. Office Management Tools II Ms Saima Gul.
CHAPTER 9 PHP AND MYSQL. A POSSIBLE SITE CONFIGURATION Application Folder index.php includes (folder)header.phpfooter.phpstyle.cssmodel (folder)mysqli_connect.php.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 8 Creating.
Day 13, Slide 1 U:/msu/course/cse/103 CSE 103 Students: Review INNER and OUTER JOINs, Subqueries. Others: Please save your.
1 CSE 103 Section 002: M/W 10:20am-12:10pm 216 Berkey Hall Section 004: T/R 10:20am-12:10pm 1210 Anthony Hall.
Enhancing Forms with OLE Fields, Hyperlinks, and Subforms – Project 5.
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Microsoft Access 2010 Chapter 3 Maintaining a Database.
Microsoft FrontPage 2003 Illustrated Complete Creating a Form.
DAY 16: ACCESS CHAPTER 1-2 Rahul Kavi October 8,
Grade Book Database Presentation Jeanne Winstead CINS 137.
PHP getting data from a MySQL database. Replacing XML as data source with MySQL Previously we obtained the data about the training session from an XML.
NMD202 Web Scripting Week5. What we will cover today PHP & MySQL Displaying Dynamic Pages Exercises Modifying Data PHP Exercises Assignment 1.
U:/msu/course/cse/103 Day 18, Slide 1 CSE 103 Day 18 If you are not enrolled in CSE 103, please save and log out by 10:10.
Microsoft FrontPage 2003 Illustrated Complete Integrating a Database with a Web Site.
Gold – Crystal Reports Introductory Course Cortex User Group Meeting New Orleans – 2011.
U:/msu/course/cse/103 Day 03, Slide 1 CSE 103 Day 15: Database Design Students: –Read Day 2 in your textbook –Your BT feedback.
PHP and SQL Server: Queries IST2101. Steps to Design PHP Pages to Answer User Queries 1.Query generation – What SQL query do we need to retrieve the desired.
FAA Access to CPS Online for EDExpress Users - Hands-on Ginger Klock Eric Smith Session 5.
U:/msu/course/cse/103 Day 21, Slide 1 CSE 103 Makeups –If you didn’t take one over the weekend, take one TUESDAY or WEDNESDAY!
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
U:/msu/course/cse/103 Day 17, Slide 1 CSE 103 Housekeeping: –Take a makeup BT this week if not passed the 2.0 yet –Next.
Chapter 8 Manipulating MySQL Databases with PHP PHP Programming with MySQL 2 nd Edition.
U:/msu/course/cse/103 Day 08, Slide 1 CSE 103 Students: –Review days 7 and 8 if you need to go over relationships and INNER.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
Lecture 7 Conditional Scripting and Importing/Exporting.
U:/msu/course/cse/103 Day 08, Slide 1 Debrief Homework What problems arose in trying to import the data from Classical_Music.xls?
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Day 22, Slide 1 CSE 103 Day 22 Non-students: Please logout by 10:12. Students:
Unit 9.1 Learning Objectives Data Access in Code
CSE 103 Day 20 Jo is out today; I’m Carl
CSE 103 Day 15: Database Design
Practical Office 2007 Chapter 10
Database application MySQL Database and PhpMyAdmin
Questions In the PHP script mysqltest.php :
CIS 155 Table Relationship
More Selections BIS1523 – Lecture 9.
Conditions and Ifs BIS1523 – Lecture 8.
CSE Students: Please do not log in yet.
Presentation transcript:

U:/msu/course/cse/103 Day 25, Slide 1 Back-up PHP Files If you have not yet passed the 3.0 BT, make back-up copies of ALL of your PHP files (BEFORE you start today’s class work) to use when you take the 3.0 BT. –What we cover today may complicate taking the BT if you try to use it then

U:/msu/course/cse/103 Day 25, Slide 2 Review of Day 23 Create a form page, addmovie_form.php that has text boxes for the title and year Create a handler page addmovie_handler.php –Write SQL query to add title and year to tbl_Movies INSERT INTO tbl_Movies (MovieTitle, Year) VALUES ('valueForMovieTitle', valueForYear) –Use form information via $_POST[‘Name’], where Name is the name= of the form element –Use insert_autonumbered_row() to submit the query –Save new id returned by function in new PHP variable

U:/msu/course/cse/103 Day 25, Slide 3 Review of Day 23 continued Add a form element for entry of Genre data to the addmovie_form.php page. Make this form element a drop-down box. –Use only Genres listed in tbl_Genres –Use print and the CSE 103 support function dropbox_from_query() to make the dropbox on the form. (Don’t use a normal form element!) Requires a query that selects two fields: one a key value and one something to be displayed

U:/msu/course/cse/103 Day 25, Slide 4 Review of Day 23, part 3 Change the addmovie_handler.php page to also add the genre information to the database. –Assign the autonumber ID (created when title and year are added to tbl_Movies) to a variable. –Use that variable in constructing a query to add the movieID and the submitted genre info (and rank 1) to tbl_MovieGenres The $_POST['name'] for this matches the 2 nd argument to dropbox_from_query() on your form page –Use the CSE 103 support function run_action_query() to run this query.

U:/msu/course/cse/103 Day 25, Slide 5 Adding Movies Considerations Q1: How can we determine if the “add” is successful? Q2: How can we determine if a movie is in the database already? Q3: What should we do if a movie is already in the database?

U:/msu/course/cse/103 Day 25, Slide 6 A1: The IF statement The IF statement lets us perform one or another set of actions based on the value of a test. –The test must have a value of either true or false. –It uses relational operators,<>,==, etc. If true, the first set of statements after the IF are executed. If false, the statements after an else (following the if) are performed instead.

U:/msu/course/cse/103 Day 25, Slide 7 Example: IF test if ( $MovieID == 0) { print "No movie added"; } else { print "Movie added with ID = "; print $MovieID; } Autonumber IDs are never 0, so if 0 was returned, we know we didn't get a "real" ID

U:/msu/course/cse/103 Day 25, Slide 8 First Conditional Exercise Modify your addmovie_handler.php page to test whether or not the action query on tbl_Movies is successful –What does it mean that a movie was added? Display appropriate messages to the user and take other appropriate actions in each case. –What should you do if adding the record is successful? … if it is not successful?

U:/msu/course/cse/103 Day 25, Slide 9 A2 & A3: Check for a pre- existing entry and action Write an SQL query to test whether or not a MovieTitle and Year combination is already in the database. –What can we look for that we can easily test? Use the returned value in an IF test –How should we test? What does our test mean if true? If the movie IS NOT in the database, then add it as a new record and continue as before. If the movie IS in the database, display a message to that effect plus its MovieID. –STOP and do not attempt to insert the data

U:/msu/course/cse/103 Day 25, Slide 10 Dynamic Web Page Design How should I put dynamic pages together to form a site? –Organization chart is very helpful, as used in CSE 101 What information is needed to construct each page? What interface do I want to present to the user?

U:/msu/course/cse/103 Day 25, Slide 11 End-of-Term SIRS Link on the Student Site Map Three forms – Course, Lead, and Asst Comments will be considered for future course development of CSE 101 Available until Thursday, April 28th at 4pm, when UBTs are due Necessary to access your BT Feedback

U:/msu/course/cse/103 Day 25, Slide 12 UBT Databases Each student in CSE 103 currently has a MySQL database Database name is student’s msuNetID Database is currently empty unless you already submitted an Access database for us to convert

U:/msu/course/cse/103 Day 25, Slide 13 To create UBT Databases: You submit (via ) an Access db file to with desired table structures (fieldnames and datatypes) –Also look for other properties like Required? –Don't bother with lookups; we can't convert those –DO bother with relationships (helps us understand) We will create the tables in your db from your Access sample. You create the web forms and action pages to enter data into those tables and to manipulate the data as needed for your UBT project.

U:/msu/course/cse/103 Day 25, Slide 14 A good UBT should: Demonstrate good database design –Appropriate tables, fields, datatypes, keys, and relationships, as well as integrity and minimal redundancy (everything related to the 2.0 BT) Demonstrate mastery of various queries –Both Select and Action, use of functions, calculated fields, aggregate functions, etc. Demonstrate ability to learn new concepts –Use new functions, query types, etc. that we didn’t cover in-class or on any BT

U:/msu/course/cse/103 Day 25, Slide 15 Remainder of Semester Day 26 (Thurs/Mon) - In-Class BT Opportunity Day 27 (next Tue/Wed) - In-Class Helproom Day 28 (next Thurs/week from Mon) - In-Class BT Opportunity Thursday, April 28 th - UBTs due at 4 pm On Days 26 and 28, your Lead will be in the CSE 103 office during class hours if you have already passed 3.0 and need UBT help Feel free to with UBT questions when working