1
Lesson 1: Introduction to PHP and MySQL
Objective: 1. This lesson will cover the fundamentals of PHP and MySQL where it is a powerful tool for making dynamic and interactive web pages. _________________________________________________________________________
Lesson Overview: Basic introduction to PHP concepts, what you should know before learning PHP, why learning PHP is useful, and the benefits to learning PHP. 1.1 3-tier Application Environment User interaction is separated from the database through a middleware that act as a connector. Client: Used to display the interface of the application. The interface downloaded from the server. Some logical operations done here. Example: Web Browsers such as Internet Explorer, Firefox, Opera, Safari, Google Chrome and etc. Web Server + Middleware: Store and host the interface. Provide the interface to the client. Most operations are on data retrieval and manipulations. Example: Apache + PHP, IIS + ASP. Database server: Store and host data/records. Receive request and send the data/record to the web server. Example: MySQL, SQL Server, PostgreSQL, and etc.
Web page
HTTP request
Records
Database
Web server
Data request
DIT2232/ DEC3236 Web Based Programming
Lesson 1: Introduction to PHP
2
1.2 From static to dynamic web sites? Static Web Sites
A static site is a website that is written entirely using HTML. Each web page is a separate document and there are no databases or external files that are drawn upon. This means that the only way to edit this type of website is to go into each page and edit the HTML. So you would have to do it yourself using a web page editor such as FrontPage or Dreamweaver, or pay your web developer to make updates for you.
Dynamic Web Sites A dynamic website is written using more complex code such as PHP or ASP and has a greater degree of functionality. Each page of a dynamic website is generated from