Class 1Intro to Databases Goals of this class Understand the architecture behind web database applications Gain a basic understanding of what relational.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: The Basics.
1 Database Driven Web Application Clients Application Servers including web servers Database Server Traditional client-server (2-tier architecture): client:
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
BY: ALBERTO CABEZAS 4/19/2010. INTRODUCTION: PHP is considered today as one of the most famous scripting languages. PHP is widely used as a general purpose.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
1 Chapter 12 Working With Access 2000 on the Internet.
Learning Web development. 3(+1) Tier architecture PHP script Remote services Web Server (Apache, IIS) Browser (IE, FireFox, Opera) Desktop (PC or MAC)
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
Introduction to PHP. PHP Origins Rasmus LerdorfRasmus Lerdorf (born Greenland, ed Canada) PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP.
Introduction to Web Application Architectures Web Application Architectures 18 th March 2005 Bogdan L. Vrusias
Multiple Tiers in Action
Copyright 2003 The McGraw-Hill Companies, Inc CHAPTER Application Software computing ESSENTIALS    
PHP Server-side Programming. PHP  PHP stands for PHP: Hypertext Preprocessor  PHP is interpreted  PHP code is embedded into HTML code  interpreter.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
PHP Workshop ‹#› PHP: The Basics. PHP Workshop ‹#› What is it? PHP is a scripting language commonly used on web servers. –Stands for “PHP: Hypertext Preprocessor”
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
CSC 318 WEB APPLICATION DEVELOPMENT.  Introduction to Server Scripting language  Client VS Server  Introduction to PHP  PHP Files and Syntax  Function.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Advanced Web 2012 Lecture 4 Sean Costain PHP Sean Costain 2012 What is PHP? PHP is a widely-used general-purpose scripting language that is especially.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizard’s Guide to PHP by David Lash.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Internet Basics Dr. Norm Friesen June 22, Questions What is the Internet? What is the Web? How are they different? How do they work? How do they.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
Simple Database.
Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
NMED 3850 A Advanced Online Design January 12, 2010 V. Mahadevan.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
Intro to PHP Carl-Erik Svensson. What is PHP? PHP is a widely-used general-purpose scripting language that is especially suited for Web development and.
Introduction to PHP Advanced Database System Lab no.1.
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
Producing a high-impact web experience by integrate Macromedia Flash and ASP By Katie Tuttle CS 330: Internet Architecture and Programming Project.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
NMD202 Web Scripting Week5. What we will cover today PHP & MySQL Displaying Dynamic Pages Exercises Modifying Data PHP Exercises Assignment 1.
Class 1Intro to Databases Goals of this class Understand the architecture behind web database applications Gain a basic understanding of what relational.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
PHP Workshop ‹#› أطلق إبداعك 2 أطلق إبداعك 2 مدرس معتمد من مركز زووم PHP: The Basics.
The basics of knowing the difference CLIENT VS. SERVER.
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
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,
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
Submitted by: Moran Mishan. Instructed by: Osnat (Ossi) Mokryn, Dr.
PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative.
PHP using MySQL Database for Web Development (part II)
Web Database Programming Using PHP
Introduction to Dynamic Web Programming
Web Database Programming Using PHP
PHP / MySQL Introduction
BASIC PHP and MYSQL Edward S. Flores.
PHP Introduction.
Intro to PHP & Variables
Web DB Programming: PHP
Lecture 2 - SQL Injection
IntroductionToPHP Static vs. Dynamic websites
Tutorial 6 PHP & MySQL Li Xu
Introduction to World Wide Web
An Introduction to JavaScript
Hypertext Preprocessor
Web Application Development Using PHP
Presentation transcript:

Class 1Intro to Databases Goals of this class Understand the architecture behind web database applications Gain a basic understanding of what relational databases are and how they work Understand how to interact with a database using PHP Understand how to output to a client Understand how to design & construct a database Understand how to construct a site that uses dynamic content Gain an understanding of the cultural importance of databases in current culture – both professional and artistic

Class 1Intro to Databases Understand the architecture behind web database applications A 3-tier application is an application program that is organized into three major parts, each of which is distributed to a different place or places in a network. The three parts are: The Client Tier presentation interface Html or flash The Middle Tier application logic PHP The Database Tier database and programming related to managing it MySQL

Class 1Intro to Databases What relational databases are and how they work A relational database is a collection of data items organized as a set of formally-described tables from which data can be accessed or reassembled in many different ways without having to reorganize the database tables. In addition to being relatively easy to create and access, a relational database has the important advantage of being easy to extend. After the original database creation, a new data category can be added without requiring that all existing applications be modified. The relational database was invented by E. F. Codd at IBM in 1970.

Class 1Intro to Databases What relational databases are and how they work Database User Table User NamePasswordCountry FredApple1 MaryOrange2 SueKiwi1 Country Table IDCountry 1Canada 2Mexico 3USA A database is made up of tables Each table has defined columns or fields rows or records

Class 1Intro to Databases What relational databases are and how they work The standard user and application program interface to a relational database is the structured query language (SQL). SQL statements are used both for interactive queries for information from a relational database and for gathering data for reportsSQL

Class 1Intro to Databases Understand how to interact with a database using PHP PHP is used to ask questions and retrieve answers from a Database PHP is designed to work with SQL databases. It can format questions in a way the database can understand PHP has several specific commands that allow it to talk to MySQL PHP is used to output HTML to a browser, or pass information to another client-side application like Flash

Class 1Intro to Databases Understand how to output to a client Data stored in a database is usually free of any presentation markup. This means that when it is retrieved from a database nothing determines what it will look like, or how it will be displayed. This separation of content and display means that the same content can be retrieved and displayed in several formats or mediums HTML FLASH PDA CELL PHONE PDF ETC It also means that applications that use databases can be easily updated or redesigned.

Class 1Intro to Databases Understand how to design & construct a database The design of a database is one of the most important parts of a dynamic website. It determines What type of data can be stored How easily information can be accessed How fast information can be accessed What types of relationships can be made between the data How easily a database can be extended Database Architects (DBAs) usually design databases

Class 1Intro to Databases Understand how to construct a site that uses dynamic content Most site that use dynamic content display their pages in templates A template is an html page (etc) with “buckets” for content To design templates you need to understand How to retrieve data from a database How to format this data for display The basics of graphic design & user interface

Class 1Intro to Databases Understand how to construct a site that uses dynamic content

Class 1Intro to Databases Understand how to construct a site that uses dynamic content

Class 1Intro to Databases The cultural importance of databases – both professional and artistic changes in how we organize perceive separation of content and context content and display

Class 1Intro to Databases PHP Basics What is PHP? PHP: Hypertext Preprocessor PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. Like any language, PHP is made up of Variable types Built in functions It supports user defined functions It is designed to work with SQL It has it’s own syntax

Class 1Intro to Databases PHP Basics Variable types The “type” of a variable describes what sort of information a variable can store, as well as how much space that information takes up. (Think Tupperware) Scalar Types Variables of a scalar type can contain a single value at any given time Boolean$registered=TRUE; integer$age=26; float$weekly_pay=12,444.33; string$name=“Fred”; Constants define("pi", );

Class 1Intro to Databases PHP Basics Syntax Starting and Ending a program Ending a statement Statements end with a semi-colon, “;”. (Forgetting this is a common mistake) File Extensions In order for a server to recognize a php file it must end in.php Comments # this is a comment // this is also a comment

Class 1Intro to Databases PHP Basics Basic Commands Declaring a variable assigns a value to a variable $name=“Fred”; Print Print outputs as text. It can be used for plain text files or html print(“Hi”);

Class 1Intro to Databases PHP Basics Outputting to HTML HTML Hi. Our class is called “Intro to Databases”. PHP ”); print(“ ”); print(“ Hi. Our class is called \“Intro to Databases \“. ”); print(“ ”); print(“ ”); ?> Note that the quote is escaped.

Class 1Intro to Databases PHP Basics Outputting to HTML with variables HTML Hi. My name is Sharon. PHP ”); print(“ ”); print(“ Hi. My name is $name. ”); print(“ ”); print(“ ”); ?>

Class 1Intro to Databases PHP Basics Simple User Defined Functions ”); print(“ ”); print(“$a + $b ”); print(“is equal to ”); add_two_numbers($a, $b); print(“ ”); print(“ ”); function add_two_numbers($a, $b){ $c= $a + $b; print(“$c”); } ?>

Class 1Intro to Databases PHP Basics Simple User Defined Functions - A Better Way ”); print(“ ”); print(“$a + $b is equal to $c”); print(“ ”); print(“ ”); function add_two_numbers($a, $b){ $c= $a + $b; return $c; } ?>

Class 1Intro to Databases PHP Basics Constructing a simple template ”); print(“ ”); print(“ ”); // display content here print(“$content”); // end display content // end page print(“ ”); print(“ ”); print(“ ”); ?>

Class 1Intro to Databases PHP Basics Common Errors ”); print(“ ”); print(“ ”); // display content here print(“$content”); // end display content // end page print(“ ”); print(“ ”); print(“ ”); ?> Parse error: parse error in /home/denning/www/sp2004/cl_01/examples/template.php on line 8 Here the quotes are not escaped