PHP & MySQL - Getting Started

70 downloads 3303 Views 64KB Size Report
2 Nov 2007 ... PHP is free to download and use. What is a PHP ... W3Schools: PHP MySQL Connect to a Database: ... tutorials for beginners and intermediate:.
November 07

PHP & MySQL - Getting Started

Introduction to PHP & MySQL An XHTML/CSS website can provide a user with information, but cannot provide interaction. In order to do this, the site must have some form of intelligence that allows it to make decisions, based on input from the user. Javascript goes some way to doing this, but (apart from cookies, which have certain limitations), javascript cannot provide the web developer with a way to remember information that the user provides it - which allows web developers to produce truly interactive, compelling web experiences. This remembering is most commonly done with a database, a simple storage mechanism for computer data, more capable than a flat file, or a spreadsheet, due to its ability to create relationships between different sets of data - but more about that later. We are going to be using a database server called MySQL, which uses standard Structured Query Language (SQL) as the In order to talk to a database, we need a programming language that can connect to and communicate with the database, we are using PHP.

PHP in Brief • PHP stands for PHP: Hypertext Preprocessor • PHP is a server-side scripting language • PHP scripts are executed on the server • PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.) • PHP is an open source software (OSS) • PHP is free to download and use

What is a PHP File? • PHP files may contain text, HTML tags and scripts • PHP files are returned to the browser as plain HTML • PHP files have a file extension of ".php", ".php3", or ".phtml"

What is MySQL? • MySQL is a database server • MySQL is ideal for both small and large applications • MySQL supports standard SQL • MySQL compiles on a number of platforms • MySQL is free to download and use

PHP & MySQL - Getting Started

1

November 07

PHP & MySQL - Getting Started

PHP + MySQL • PHP combined with MySQL are cross-platform (means that you can develop in Windows and serve on a Unix platform)

Why PHP? • PHP runs on different platforms (Windows, Linux, Unix, etc.) • PHP is compatible with almost all servers used today (Apache, IIS, etc.) • PHP is FREE to download from the official PHP resource: www.php.net • PHP is easy to learn and runs efficiently on the server side Homework: Use google to search for each of the functions shown in todays demonstration, then note what they do and how they do it. Practice creating a few databases, and connecting to them. Links - Required Reading W3Schools: PHP Syntax http://www.w3schools.com/php/php_syntax.asp W3Schools: MySQL Introduction: http://www.w3schools.com/php/php_mysql_intro.asp W3Schools: PHP MySQL Connect to a Database: http://www.w3schools.com/php/php_mysql_connect.asp Data Driven Web Pages: http://media.wiley.com/product_data/excerpt/8X/07821414/078214148X.pdf

Links - Recommended Reading Think Vitamin: a resource for web designers, developers and entrepreneurs: http://www.thinkvitamin.com/ A List Apart: explores the design, development, and meaning of web content, with a special focus on web standards and best practices: http://www.alistapart.com Killer PHP: Video (yes, VIDEO!) tutorials for beginners and intermediate: http://www.killerphp.com/ Links - Further Reading These links are more comprehensive, and are only recommended if you find the subject material easy, or wish to dig much deeper, focus on understanding the concepts in the lecture before attempting to read and understand these. MySQL: The homesite for MySQL: http://www.mysql.com/ PHP.Net: The homesite for PHP, including news, information and the manual: http://php.net/ Wikipedia: SQL entry: http://en.wikipedia.org/wiki/SQL Wikipedia: MySQL entry: http://en.wikipedia.org/wiki/SQL Wikipedia: PHP entry: http://en.wikipedia.org/wiki/Php

PHP & MySQL - Getting Started

2

November 07

PHP & MySQL - Getting Started

PHP & MySQL - What to expect from this module Getting Started

Day 1

Introduction To Data Driven Sites Similarities between Javascript & PHP MySQL Connecting to a Database

Code Basics

Day 2 Day 2 Day 3 Day 3 Day 4 Day 4

PHP & HTML Text PHP Decision Making Functions SQL Arrays Forms

Sessions

Day 5

Sessions & Authentication

PHP & MySQL - Getting Started

3