Creating Databases for Web applications Introductions & overview Administration Moodle HW: Sign on, register for course, introduce yourself on Moodle.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

Tutorial 6 Creating a Web Form
Creating Web Page Forms. Objectives Describe how Web forms can interact with a server-based program Insert a form into a Web page Create and format a.
Tutorial 6 Working with Web Forms
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Attribute databases. GIS Definition Diagram Output Query Results.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Creating Web Page Forms
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Creating Databases applications for the Web Reprise. Basic HTML review, forms Preview: Server side vs client side Classwork: create HTML forms and check.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
+ 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.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 13 Slide 1 Application architectures.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Creating Databases SELECT. UPDATE. Demonstrate projects. Classwork / Homework: Prepare to choose teams & projects.
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
20 April 2002CCSC NE Worcester, MA Design and Implementation of a new course: Creating databases for web applications Jeanine Meyer & Michael Conry Mathematics/Computer.
Creating databases for web applications
Introduction to course. Refresher on client/server; JavaScript.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
© 2011 Delmar, Cengage Learning Chapter 9 Collecting Data with Forms.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
MGS 351 Introduction to Management Information Systems RECITATION 11.
Creating Databases for Web Applications Work session Open Source versus Proprietary important topics HW: finish* projects. Look at final quiz guide. Final.
Creating databases for web applications SQL. Systems design. ER diagrams. Data flow diagrams. Storyboards. Homework: Plan database and applications for.
Web Application Programming Carol Wolf Computer Science.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
PHP meets MySQL.
1 Accelerated Web Development Course JavaScript and Client side programming Day 2 Rich Roth On The Net
20-753: Fundamentals of Web Programming 1 Lecture 1: Introduction Fundamentals of Web Programming Lecture 1: Introduction.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
© 2010 Delmar, Cengage Learning Chapter 8 Collecting Data with Forms.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
ITCS373: Internet Technology Lecture 5: More HTML.
Creating databases for Web Applications php basics. ing. phpMyAdmin to set up MySQL. Homework: Use phpMyAdmin. Make posting with [unique] source on.
Creating Databases Local storage. join & split Classwork: show 1 table application. Share designs for oscars application. Adaptive select. Homework: [Catch.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Creating Databases applications for the Web Basic HTML review, forms Preview: Server side vs client side Flash HW: Review HTML forms and FLASH examples.
Creating Web Documents: Introductions Background Administration Course overview Assignment: CourseInfo survey. Find 1 good & 1 bad web site. Reading.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
1 Final Review. 2 Final Exam  30% of your grade for the course  December 9 at 7:00 p.m., the regular class time  No makeup exam or alternate times.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
Creating Databases for Web applications Server side vs client side PHP basics Homework: Get your own versions of sending working: both html and Flash!
Creating Databases for Web applications SQL. XML. Linked Lists. NoSQL. Homework: Keep working on projects. Post constructive feedback on other projects.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Database Connectivity and Server-Side Scripting Chapter 12.
Creating Databases for Web Applications 3-Tier. Design vs Function vs Content. More SQL. More php. Homework: work on final projects.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 1: Introduction to IS2803 Rob Gleasure
Creating Databases applications for the Web: week 2 Basic HTML review, forms HW: Identify unique source for asp, php, Open Source, MySql, Access.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
PHP Form Processing * referenced from
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
XP Tutorial 6New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
Creating Databases for Web applications
Confirm teams. Review of diagrams. SELECT problems.
Introduction to Dynamic Web Programming
Creating Databases Local storage. join & split
Creating databases for web applications
Tonga Institute of Higher Education IT 141: Information Systems
Web Application Development Using PHP
Presentation transcript:

Creating Databases for Web applications Introductions & overview Administration Moodle HW: Sign on, register for course, introduce yourself on Moodle. Post source on php.

Introductions Jeanine Meyer, Mathematics/Computer Science –Ph.D. in Computer Science –IBM Research, IBM EduQuest (corporate grants) Pace University Consulting/K-12 Faculty development –books: Multimedia in the Classroom, Programming Games using Visual Basic, Creating Databases for Web Applications with PHP and ASP, Beginning Scripting through Game Creation, The Essential Guide to HTML5, HTML5 and JavaScript projects, Elementary Number Theory with Programming –Hobbies/Interests: piano, flute, politics, community volunteer, origami, grandchildren, programming! You

NOTE The HTML5 and JavaScript Projects book (on reserve in Library) has chapters –HTML, php for sending –HTML, php, MySQL example

General objectives Learn how to learn –Practice looking up and using sources Learn how to build large[r] applications –Make proposals, make and use diagrams –Work in teams Make presentations Practice concise writing –Blog entries, abstracts (1-pagers)

Moodle Instructional support tool IT IS A REQUIREMENT that you check this regularly. –You will be required to make postings to specific Discussion Forums. Hopefully, you will make additional postings. –You are required to read postings.

References There will be assignment(s) to find and describe on-line sources Many online and off-line reference –Note: Creating Web Databases with PHP and ASP out-of-date! Coding examples in book for old php. though much is relevant: general background on middleware, HTML, SQL. Design of examples. –HTML5 and JavaScript Projects book better!

Course structure Each day will include lecture, demonstration, discussion, exercises Required postings, homework Team presentations: explanation and enhancements of sample projects Midterm plus pop quizzes one original project (can be team) –initial presentation, with diagrams –Final presentation, including demonstration, showing of working code Extra credit: talks on suggested topics (for example, alternatives to php such as ASP.net, Ruby on Rails; alternatives to SQL; Big Data; etc.)

Course content Course content: practical and (some) theoretical tools for creating Web applications involving databases. (Systems design) Describe (logical) function using diagrams –Entity relationship –Data Flow diagrams –Storyboard (Systems build) Requires middleware=server-side tools. We will use Open Source software (PHP and MySQL)

What is a data base? A data base is organized information. A data base management system (DBMS) is a product that supports implementation & use of databases. HOWEVER, generally, the term database is reserved for something using a standard relational DBMS tool –DBMS is the product/tool: MySQL, Access, (Oracle, DBII, etc.) –The specific database, for example, the [toy] database examples for this course, are implemented using a particular DBMS

Examples of things not a relational database Flat file –For example, will show php code used for the state capital quiz. This is an example of parallel structures: two arrays, one for the names of the states and one for the names of the capitals. XML file Linked lists Hash table Key-value pairs

Big Data partially a marketing term / buzz word Attributes are –volume -- big –velocity – changes a lot… –variability – greatly variable in formats plus attribute that the organization using it may not control the data Example: analyzing uses of a term (say, "fiscal cliff") in twitter posts over a set time frame OR last N postings. Requires mixture of techniques.

A relational Database …consists of tables –Tables hold records (= rows) Records hold fields = attributes (= columns) A relational database supports fields in a record that point to/link/refer to records in the same or other tables. Database(s) most probably exist on campus –student table: major, gpa, address. –course table: section, instructor, time, location –enrollments: section & student, semester

All together now Database –Tables Records –Fields Relationships: fields that refer to records in the same or other tables.

Database terminology Primary key: field that uniquely defines a record. Often generated automatically by DBMS foreign key: field in record in one table that ‘is’/points to a record in another table Or to a record in the same table. The field with the foreign key would not be the primary key field. –orderlist = table of orders. Each order includes as one of the fields a customer id. This customer made the order.

Work up example Information is: courses, sections, enrollments, teachers, schedule, more? What are the tables? What are records in each table? NOTE: it takes time to design a database.

Structured Query Language Unlike much else in computing, databases follow standards. Everything said so far applies to MySQL, Access, Oracle, PostgreSQL etc. SQL is … [a] structured query language. –SELECT question, answer, points FROM questions WHERE category = chosencategory –INSERT INTO customers VALUES (fname, lname, billing, , pass) Syntax (format & punctuation) is tricky!

MySQL Open source dbms we will use with php. (some actions) done using phpmyadmin –May do initial definition of tables –May use for debugging did my php script put something in my database? We (our php code) create(s) SQL to access / modify the database

Systems Design …refers to functional specification of system (what it should do, not especially how it looks or how it is done) Use diagrams to specify databases, processes, scripts/Web pages. –tools (computer aided systems engineering=CASE tools) & methodologies exist. We will be less formal. Create diagrams using PowerPoint or any drawing tool.

Diagrams Are important! Will use [at least] 3 types in this course –Entity relationship Show data and relationships –Data flow Show agents, programs, data stores –Story board Connections between programs (scripts)

Question databank table question_id Question Answer (answer pattern) Value Category Players table player_id Player name Score lastplayed date history table question_id player_id whenplayed correct 0 0 ER diagram

Player Editor Play game Edit questions Questions DB Player scores Data flow diagram (process diagram) for quiz show History DB

Create quiz tables (php only) Input Questions (handles form input) Choose category Ask question Check answer Clear tables Include/Required file: opendbq Show scores Storyboard

Product catalog Product id Product name Picture Cost Customer list Customer ID first name last name Billing information Password Order list Order ID Customer ID Date Status Total Ordered items Order ID Product Quantity 0 ER diagram for on-line store 0

Customer Billing system (timed event) Browse/ Order Billing Catalog Customer list Current orders Ordered items Shipping clerk Shipping Data flow (process) diagram for on-line store. Note that this is the information/data flow, not the flow of goods. The shipping operation produces a physical product: the collection of ordered items, packed and set off for delivery.

Storyboard of partial implementation: ordering Create tables (php only) Include/require: opendbo Input products Order product makeorder Shopping cart Submit order Delete current customer cookie Include/require: displaycartfunction

Web terminology: standard Web files are stored on the server computer. The browser (IE, Firefox, Opera, etc.) is on the client computer. Hypertext Markup Language (HTML) files are requested by the browser from the server and interpreted by the browser. This could include display of image files, playing of video or audio, etc. Stateless system: server does not ‘remember’ anything between requests.

but, stateless-ness wasn’t good enough … to support real, practical applications involving –files and databases –state information—information valid across multiple pages Need for so-called middleware / server-side Alternatives were/are Common Gateway Interface (cgi) programming and Java applets.

Three-tier implementation model Code to be run on the client (by browser) –HTML and JavaScript Code to be run on the server –php Code (queries) executed by the DBMS –SQL queries constructed by php code

Three tier logic model Presentation Business logic Information

Cloud computing extends / replaces 3 tier model. NOTE: much use of data NOT in an organization's possession or control. –Note: company can use ("rent") storage & processing in "the cloud" and still control/own the data. OR –Use data from other organizations Example: access Twitter for latest tweets.

HTML5 new features include form validation: specifying what is expected in input elements of forms and promising that browser will perform those checks Show – /html5logoscale.html Shows slider (range) /html5logoscale.html – /bouncingballinputsimg.html Checks for numbers in the indicated rangehttp://faculty.purchase.edu/jeanine.meyer/html5 /bouncingballinputsimg.html – /addmessage.html radio buttons. Opera browser supplies color palettehttp://faculty.purchase.edu/jeanine.meyer/html5 /addmessage.html

Server-side / Middleware Files (aka scripts) ‘in’ PHP (or ASP, cold fusion, ruby on rails, perl, etc.) are requested by browser. However, the server processes the PHP instructions in the files to –produce an HTML file for interpretation by the browser and –access & modify data (files, databases) on the server. NOTE: database(s) are on the server! –store & access so-called cookies on the client computer. Cookie is a special, small file. HTML5 term: localStorage (Flash term: sharedstorage) extra credit opportunity

Development / testing for class Create / register to have MySql database We/you will create html/JavaScript files PLUS php files Upload all files to your site (account) Some php files (aka scripts) will access (read & write) MySql Some html and php files will populate (put data into) html tables

Contrast This is not like general practice of testing on your computer and later uploading complete tested application!

PHP Personal Home Page  PHP: Hypertext Preprocessor Language plus a set of built-in procedures and properties –language includes support for user-defined objects. Open Source

Warnings SQL is a very powerful language. –It may take time to produce 1 SQL statement The equivalent of many lines of code in another programming language. Writing php code, including code generating SQL statements, can involve complex syntax –For example, single quotes within double quotes –References to variables within quoted strings.

General format of SELECT SELECT [modifier such as DISTINCT] field1, field2, expression [COUNT(field)] FROM tablea, tableb, … WHERE condition(s) GROUP BY fieldx ORDER BY fieldy HAVING condition LIMIT n, m

$sel="SELECT question_id, question, ans, value from questions "; $sel= $sel. " WHERE category= '". $pickedcategory. "'"; $result=mysql_db_query($DBname, $sel, $link); $NoR=mysql_num_rows($result); Single quote within double quotes

Reprise When we write php, we write –plain HTML –php that uses functions that use operating system on server read/write files send –php that produces HTML –php that sends SQL to MySQL and gets results back that php uses to produce HTML

Confirmation on information so far What is a database? A database is made up of …. Describe 3 tier model –operationally (implementation) in terms of [what] code –functionally (logic) in terms of what function

continued… What does browser do? What does it interpret? What is done on/by the server? What is done by the DBMS (MySQL)?

Homework Go to students.purchase.edu and sign up for webspace AND database –Don't sign up for webspace if you already have it and don't sign up for database if you already have it. –You will get an with information. Your account will be on socialsoftware.purchase.edu Visit Moodle course site. –Introduce yourself on Introductions, etc. forum. –Find, briefly review and post your assessment of an on- line source for PHP on Resources YOU find forum. –Must be unique. If someone has done "yours", find another site. –NOTE: will repeat this for other topics