2. PHP == ‘HYPERTEXT PREPROCESSOR’
open-source, server-side scripting language
Used to generate dynamic web-pages
PHP scripts reside between reserved PHP tags
• This allows the programmer to embed PHP scripts within HTML
pages
3. Interpreted language, scripts are parsed at run-time
rather than compiled beforehand
Executed on the server-side
Source-code not visible by client
• ‘view source’ in browsers does not display the PHP code
Various built-in functions allow for fast development
Compatible with many popular databases
4. PHP is a general-purpose server-side scripting language
originally designed for web development to produce
dynamic web pages .
PHP can interact with My SQL databases.
5. Structurally similar to C/C++
Support procedural and object-oriented paradigm (to
some degree)
All PHP statements end with a semi-colon
Each PHP script must be enclosed in the reserved PHP
tag
<?php
……
?>
6. Standard C, C++, and shell comment symbols.
//C++ and java-style comment
# shell-style comments
/* C-style comments
These can span multiple lines*/
7. PHP variables must begin with a “$” sign.
Case-sensitive
Global and locally-scoped variables.
• global variables can be used anywhere
• local variables restricted to a function or class
Certain variable names reserved by PHP
• form variables ($_POST, $_GET)
• server variables($_ SERVER)
Etc.
8. • MySQL is a database system used on the web
• MySQL is a database system that runs on a server
• MySQL is ideal for both small and large applications
• MySQL is very fast, reliable, and easy to use
• MySQL uses standard SQL
• MySQL compiles on a number of platforms
• MySQL is free to download and use
• MySQL is developed, distributed, and supported by
Oracle Corporation
• MySQL is named after co-founder Monty Widenius's
daughter: My
9. • The data in a MySQL database are stored in tables. A
table is a collection of related data, and it consists of
columns and rows.
• Databases are useful for storing information categorically.
A company may have a database with the following
tables:
• Employees
• Products
• Customers
• Orders
10. • PHP combined with MySQL are cross-platform (you can
develop in Windows and serve on a Unix platform)
11. • A query is a question or a request.
• We can query a database for specific information and
have a record set returned.
• Look at the following query (using standard SQL):
SELECT LastName FROM Employees
• The query above selects all the data in the "LastName"
column from the "Employees" table.
12. PHP 5 and later can work with a MySQL database using:
• MySQLi extension (the "i" stands for improved)
• PDO (PHP Data Objects)
Earlier versions of PHP used the MySQL extension.
However, this extension was deprecated in 2012.
13. • The CREATE DATABASE statement is used to create a
database in MySQL.
• The following examples create a database named
"myDB":