0% found this document useful (0 votes)
3 views

LESSON PHP

This lesson plan outlines a beginner's course on PHP for web development, covering topics such as PHP basics, variables, mathematical and conditional statements, arrays, functions, objects, MySQL queries, and file handling. It includes practical applications like AJAX requests and session management, culminating in a project to create a leave filing system. Each lesson builds on fundamental programming concepts essential for web development using PHP.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

LESSON PHP

This lesson plan outlines a beginner's course on PHP for web development, covering topics such as PHP basics, variables, mathematical and conditional statements, arrays, functions, objects, MySQL queries, and file handling. It includes practical applications like AJAX requests and session management, culminating in a project to create a leave filing system. Each lesson builds on fundamental programming concepts essential for web development using PHP.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Lesson Plan: PHP for Web Development beginners

Lesson 1: What is PHP?


PHP, which stands for "Hypertext Preprocessor," is a widely used open-source scripting
language that is primarily used for web development. It was created by Rasmus Lerdorf in the
mid-1990s
Lesson 2:Variables
Variables
Data types
Interger
Float
Boolean
String
Date
Null
Array
Object
Convert
Lesson 3: Mathematical and Conditional Statements
Mathematical Operations – (+ - * / %)
If and else statements and Comparison operators (==, !=, >, <,)
Logical operators (AND, OR, NOT)
Loops (for, while)
Break and continue statements
Function parameters and return values
Lesson 4: arrays and functions
Iterating arrays
Working with multidimensional arrays
Array manipulation and common array functions
Push - adds new items to the end of an array.
Pop - removes (pops) the last element of an array.

Shift - removes the first item of an array

Unshift - adds new elements to the beginning of an array.

Special Functions in array


For each - provides an easy way to iterate over arrays.
array_map() - Sends each value of an array to a user-made function, which
returns new values
array_filter() - Filters the values of an array using a callback function
array_splice() - changes the contents of an array by removing or replacing
existing elements and/or adding new elements in place
array_slice() - Returns selected parts of an array
arsort() - Sorts an associative array in descending order, according to the value
asort() - Sorts an associative array in ascending order, according to the value
Lesson 5: Objects
Manipulation of object properties
Lesson 6: MYSQL QUERIES
What is MYSQL?
-MySQL is an open-source relational database management system (RDBMS)
that provides an efficient and reliable way to manage, store, and retrieve
structured data.
Setting up the mysql database
QUERIES
INSERT - INSERT INTO `employee`(`employee_id`, `firstname`, `middlename`,
`lastname`, `status`, `leaves`, `date_hired`) VALUES ('[value-1]','[value-
2]','[value-3]','[value-4]','[value-5]','[value-6]','[value-7]')

SELECT - SELECT * FROM `employee`

WHERE CLAUSE - SELECT * FROM `employee` WHERE employee_id = 1


LOGICAL OPERATORS (AND / OR NOT) - SELECT * FROM `employee`
WHERE firstname = ‘Allen’ AND lastname = ‘Young’
UPDATE - UPDATE `employee` SET `employee_id`='[value-
1]',`firstname`='[value-2]',`middlename`='[value-3]',`lastname`='[value-
4]',`status`='[value-5]',`leaves`='[value-6]',`date_hired`='[value-7]' WHERE 1
DELETE - DELETE FROM `employee` WHERE 0

Order by - SELECT * FROM `employee` ORDER BY firstname ASC / DESC


Distinct - SELECT DISTINCT status FROM employee
SUM - SELECT status,SUM(leaves) FROM employee GROUP BY status
Max - SELECT max(leaves) FROM `employee`
Min - SELECT min(leaves) FROM `employee`
Concat - SELECT CONCAT(firstname,' ',lastname) FROM employee
Alias - SELECT CONCAT(firstname,' ',lastname) as thecombine FROM
employee
group by - SELECT status FROM `employee` GROUP BY status

THE INNER JOIN


SELECT CONCAT(employee.firstname,' ',employee.lastname), salary.salary
FROM employee INNER JOIN salary ON employee.employee_id =
salary.employee_id;
Application of MYSQL Queries to PHP
Prepared statements (avoiding sql injection)

Lesson: 7 Javascript to PHP


Receiving an ajax request and saving a database
Retrieving data from database using ajax request
Lesson 8: Sessions
What are sessions
How to use sessions
Lesson 9: File handling
How users could upload file
How users could retrieve the uploaded file

The final Output: LEAVE FILING SYSTEM

You might also like