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.

Slides:



Advertisements
Similar presentations
Teacher Functions. Teacher Functions in OAS Create Tests Assign Tests to a Class View Reports of Student Performance.
Advertisements

SQL-week5-1 In-Class Exercise Answer IST 210 Organization of Data IST2101.
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
Video, audio, embed, iframe, HTML Form
HTML Form and PHP IST Review of Previous Class HTML table and PHP array Winner is chosen automatically using rand() function.
MIS 3200 – Unit 4 Complex Conditional Statements – else if – switch.
Faculty of Sciences and Social Sciences HOPE PHP – Working with Input Stewart Blakeway FML 213
LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and.
Computing Concepts Advanced HTML: Tables and Forms.
PHP and SQL Server: Queries IST2101. Three-Tier Architecture Three-tier architecture means that the Web server and the DBMS are on separate servers IST2102.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Working with Forms in JavaScript (NON-audio version) © Dr. David C. Gibbs
Database Updates Made Easy In WebFocus Using SQL And HTML Painter Sept 2011 Lender Processing Services 1.
SQL for Data Retrieval. Running Example IST2102 Data Preparation Login to SQL server using your account Download three SQL script files from wiki page.
CST JavaScript Validating Form Data with JavaScript.
+ Connecting to the Web Week 7, Lecture A. + Midterm Basics Thursday February 28 during Class The lab Tuesday, February 26 is optional review Class on.
MS3304: Week 4 PHP & HTML Forms. Overview HTML Forms elements refresher Sending data to a script via an HTML form –The post vs. get methods –Name value.
ITM © Port, Kazman1 ITM 352 HTML Forms, Basic Form Processing.
Advance Database Management Systems Lab no. 5 PHP Web Pages.
Application Development Description and exemplification of server-side scripting language for server connection, database selection, execution of SQL queries.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
HTML Forms What is a form.
INTERNET APPLICATION DEVELOPMENT For More visit:
Deleting and Updating Records in MySQL using PHP Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1.
1 Insert, Update and Delete Queries. 2 Return to you Address Book database. Insert a record.
Server-side Scripting Powering the webs favourite services.
Creating a Web Site to Gather Data and Conduct Research.
A little PHP. Enter the simple HTML code seen below.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
PHP meets MySQL.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
HTML and FORMS.  A form is an area that can contain form elements.  Form elements are elements that allow the user to enter information (like text fields,
HTML FORMS GET/POST METHODS. HTML FORMS HTML Forms HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes,
HTML Form and PHP IST Review of Previous Class HTML table and PHP array Winner is chosen randomly using rand() function.
Programming Assignment 3 Add forms in your web page so that visitors can add a comment about your web page – Example:
CHAPTER 7 Form & PHP. Introduction All of the following examples in this section will require two web pages. The first page retrieves information posted.
+ Introduction to Class IST210 Class Lecture. + Course Objectives Understand the importance of data, databases, and database management Design and implement.
Diagnostic Pathfinder for Instructors. Diagnostic Pathfinder Local File vs. Database Normal operations Expert operations Admin operations.
Creating PHPs to Insert, Update, and Delete Data CS 320.
PHP Form Introduction Getting User Information Text Input.
STRUCTURED QUERY LANGUAGE SQL-III IST 210 Organization of Data IST210 1.
Exercise 1: IF/ELSE Step 1: Open NotePad++ and create “number.php” in your webspace Step 2: Write codes to do the following 1.Generate a random number.
Intro to Forms  HTML forms are used to gather information from end-users.  A form can contain elements like radio- buttons, text fields, checkboxes,
PHP and SQL Server: Connection IST2101. Typical web application interaction (php, jsp…) database drivers 2IST210.
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.
Database Access Control IST2101. Why Implementing User Authentication? Remove a lot of redundancies in duplicate inputs of database information – Your.
Field Trip #24 Setting Up a Web Server. Apache Apache is one of the most successful open source web servers In 1995 the most popular web server was the.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring Forms, HTML5 layout.
HTML FORM Lab Exercise IST Guideline Add forms in your web page so that visitors can add a comment about your web page Forms should include the.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
HTML FORM AND PHP IST 210: Organization of Data IST210 1.
Form Data (part 2) MIS 3502, Fall 2015 Brad N Greenwood, PhD Department of MIS Fox School of Business Temple University 11/10/2015 Slide 1.
PHP AND SQL SERVER: QUERIES IST 210: Organization of Data IST210 1.
INTERNET APPLICATIONS CPIT405 Forms, Internal links, meta tags, search engine friendly websites.
CS 281 – Fall 2010 Lab 4 Parametric Query and Forms in MS Access.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
HTML FORM. Form HTML Forms are used to select different kinds of user input. HTML forms are used to pass data to a server. A form can contain input elements.
Day 22, Slide 1 CSE 103 Day 22 Non-students: Please logout by 10:12. Students:
How To Make Easysite Forms By Joshua Crawley Contact:
DATABASE ACCESS CONTROL IST Question Almost every PHP page needs to interact with database, does that mean sqlUsername and sqlPassword need to be.
PHP and SQL Server: Connection IST 210: Organization of Data IST2101.
A little PHP. Enter the simple HTML code seen below.
HTML FORM Assignment P4 IST Guideline Add forms in your web page so that visitors can add a comment about your web page Forms should include the.
PHP AND SQL SERVER: CONNECTION IST 210: Organization of Data IST210 1.
Form Data (part 2) MIS 3502, Fall 2015 Jeremy Shafer Department of MIS
A little PHP.
HTML Forms and User Input
Presentation transcript:

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 have been sent to everyone – Always use team webspace and SQL Server account for the project, not your personal ones! Wednesday’s class: Team discussion on Report 4

Labs We have already announced 6 required labs – HTML basics; PHP basics; IF/ELSE and Loop; HTML form; PHP and SQL Server: Connection; PHP and SQL Server: Queries (case 3a) – The first 6 exercises  5% lab exercise credits We will have several additional lab exercises and they are optional – The first one will be announced today – You can earn bonus points by finishing them – Bonus points might be used to curve the final grade Depends on how far you are from the curving margin Depends on how many extra labs you complete

What we have so far Using PHP to access and query the database and display results on webpage (week11-2) – IST2104

What we have so far Query the database with constraints (week11-3) –

What a cool website looks like Text box Checkboxes Dropdown lists Submit buttons

HTML Form Element Review: Text Fields Text fields are used when you want the user to type letters, numbers, etc. in a form IST2107

HTML Form Element Review: Submit Button When the user clicks the "Submit" button, the content of the form is sent to another file, which is defined by action attribute of the tag IST2108

HTML Form Element Review: Radio Buttons Radio Buttons are used when you want the user to select one of a limited number of choices IST2109 Pick a student (0-4)! Value that will be passed to the process pageValue show on the page

HTML Form Element Review: Checkboxes Checkboxes are used when you want the user to select one or more options of a limited number of choices. IST21010 Pick a student (0-4)!

HTML Form Element Review: Dropdown lists Dropdown lists let the user choose from a set of given options. IST21011 Pick a student (0-4)!

Revisiting priceline.com Text box Checkboxes Dropdown lists Submit buttons

Today’s Topic: Steps to Design PHP Pages to Answer User Queries 1.Query generation – What SQL query do we need to retrieve the desired information? 2.HTML form design – What form element(s) are most suitable for user input in this case? 3.Query processing and result display – How to query the database and display the results using PHP?

Case Study I want a website to show me the information of all projects which are assigned to one or more specific employees User input example: 1 - Mary Jacobs 5 - Heather Jones

Step 1: Query Generation Write SQL query to show the projects which are assigned to employees 1-Mary Jacobs and 5-Heather Jones

Step 1: Query Generation Write SQL query to show the projects which are assigned to employees 1-Mary Jacobs and 5-Heather Jones SELECT * FROM PROJECT WHERE ProjectID IN (SELECT ProjectID FROM ASSIGNMENT WHERE EmployeeNumber IN (1,5));

Step 2: HTML Form Design Is the following design appropriate? I want a website to show me the information of all projects which are assigned to one or more specific employees Problems: 1.Users may not know which employees are in the database 2.Users may not know what information is needed (employee number, or employee name, or both?)

Step 2: HTML Form Design Solution: When possible, give users a list of options to choose from Is the following design appropriate? I want a website to show me the information of all projects which are assigned to one or more specific employees Problem: Selection of more than one employee is not allowed.

Step 2: HTML Form Design Solution: Using checkboxes Is the following design appropriate? I want a website to show me the information of all projects which are assigned to one or more specific employees

Step 2: Code Specification IST21020 case4.php Retrieve the IDs and names of all employees from database Use the “while loop” to generate a checkbox for each employee Name of the array which stores the user’s choices Value that will be passed to the process page Value shown on the webpage

Step 3: Query Processing process_case4.php This is the SQL Query we wrote in Step 1. Employee numbers are obtained from user input

Case 4. Try it yourself Download the case4.php and process_case4.php from course website. Open case4.php and process_case4.php from NotePad++ and add your database information to both files IST21022 Input your own information

Case 4. Try it yourself (cont’d) Visit the php page to query your database – IST21023

In-class Exercise: Case 5 Create PHP webpages to show the information of all employees which are assigned to one or more specific projects –

Step 1: Query Generation Write SQL query to show the employees which are assigned to projects Q3 Portfolio Analysis and Q3 Tax Preparation Execute the query in SQL Management Studio to make sure you retrieve the desired result

Step 2: HTML Form Design Create case5.php in your webspace, copy from case4.php and modify it IST21026 Action to which PHP page?

Step 2: HTML Form Design (cont’d) Modify your case5.php IST21027 Modify this query to retrieve all projects instead of employees Modify these lines to display all the projects using checkboxes

Step 3: Query Processing Create process_case5.php, copy from process_case4.php and modify it IST21028 What ID should you use now? Put the SQL Query you wrote in Step 1 here. The IDs are obtained from user input.

Lab Exercise: Case 6 (Bonus Point) I want a website to show me the assignment information between all employees from one specific department and one or more specific projects I want a website to show me the assignment information between all employees from one specific department and one or more specific projects User input example: Department: Accounting Projects: Q3 Portfolio Analysis Q3 Tax Preparation Corresponding output: