PHP with PDO and OOP for beginners
4.0 (20 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
238 students enrolled
Wishlisted Wishlist

Please confirm that you want to add PHP with PDO and OOP for beginners to your Wishlist.

Add to Wishlist

PHP with PDO and OOP for beginners

Learn PHP with PDO, Object Oriented PHP programming, MySQL and Bootstrap to create powerful and secure websites and apps
4.0 (20 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
238 students enrolled
Created by Eng Ali Mehdy
Last updated 5/2016
English
Price: $20
30-Day Money-Back Guarantee
Includes:
  • 6 hours on-demand video
  • 24 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Create Databases
  • Learn MySQL with PHP
  • Learn Basics of PHP Programming
  • Learn PDO with PHP to create secure web applications
  • Learn Object Oriented PHP Programming
  • Create advanced, well designed, responsive PHP and PDO based web applications
  • Learn Bootstrap
  • Create a powerful and secure login system
  • Learn Object Oriented Programming with PHP
  • Sessions and Cookies in PHP
  • And much much more
View Curriculum
Requirements
  • Just a text editor
Description

PHP is one of the most popular programming languages. In this series, we will learn PHP programming basics, using a local server. Then we will use a PHP layer known as PHP data object PDO, to create secure and portable web applications. As a bonus, we will learn SQL and Bootstrap basics, to design databases, and create responsive platforms. At the end, we will create Object Oriented Programming functions and classes, and this section will help students to start their next step, which is learning a PHP framework. This course is meant for total beginners in any programming language. At the end of this course, you will be able to create databases, bootstrap designs, secure and responsive web applications with a strong login system.

Who is the target audience?
  • This course is meant for newbies in PHP
  • This course is for developers who wants to learn PDO
  • This course is for PHP programmer who want to learn Object Oriented Programming
  • This course is for absolute beginners in programming
Compare to Other PHP Courses
Curriculum For This Course
74 Lectures
05:47:14
+
Installations and Workspace
8 Lectures 27:10

PHP is one of the best programming languages used in web development and by almost thousands of websites like Facebook and Quora. It is a server-side language that recommends a server to execute PHP scripts. I recommend starting learning PHP language before PHP frameworks. The language itself will help us to figure out how to resolve errors and how to build and design our project.

Preview 05:15

In this course, we will need to work with a server like wamp for windows and mamp for Mac OS. And for databases, I recommend to download and install MySQL server with MySQL workbench. We are going to work locally using wamp.

Softwares Needed
03:27

We will encounter some errors while we are installing our local server, and we should close all softwares that run and test the port 80. This lecture will help to eliminate those startup errors that all PHP newbie will stuck in them for hours.

Wampserver Startup Errors
02:27

In this lecture, we are going to see the difference between server-side languages like PHP, Python, Ruby, and Java and client-side languages like JavaScript, HTML, and CSS.

Server Side vs Client Side
02:59

In this lecture, we will learn how a communication occurs between a computer and database, using a layer used by PHP and called Database Abstraction Layer.

Database abstraction Layer
02:01

PDO is a lightweight interface, to access databases using PHP, and each database driver like MySQL, SQLite and Oracle should implement PDO interface. In this lecture we will learn about why PDO is more secure than other interfaces.

PHP Data Object PDO
02:42

PHP is a server-side language. And to run .php extension files, and PHP scripts, those files should be installed in the local root of the server.

Server Folder
03:35

SQL injection is a way used by hackers to access and break web application using URL or the login form of a website. It is used by developer to test if their project is vulnerable and weak, and needs some improvements.

SQL Injection
04:44
+
PHP Basics
23 Lectures 01:36:30

In this lecture, we will learn how to start typing PHP and what parts of a web page, the PHP interpreter execute using the PHP tags <?php ?> to identify it.

Tags
02:03

In this lecture, we learn how to print and echo results, and we will see the difference between them. We have a third function to print results: print_r() and we will use it later.

Echo and Print
02:39

In this lecture, we will learn how PHP is different than other static languages and what types we can use in our PHP scripts. Usually we can define strings, integers, arrays, floats, doubles, and more.

Variables
08:41

In this lecture, we will learn how to make conditions into specific results and what is the value returned inside each condition.

IF ELSE Conditions
02:20

In this lecture, we will see the difference between equality == and strict equality ===. Usually, equality will compare 2 variable values without caring about their types, and strict equality will compare variable types and values.

Equality and Strict Equality
02:32

In this lecture, we will learn how to increment number using ++ and decrement them using - -.

Increment and Decrement
03:12

There is a big difference between elseif and else if, when we are typing PHP scripts. We will take a simple example to understand it.

Elseif and Else If
03:28

In this lecture, we will learn about while and do-while loops. The result will be the same, but syntax and slightly different.

While and Do-While
03:01

In this lecture, we will learn about the other loop method in PHP, For and foreach. Usually we use foreach when we are iterating over an associative array.

For and Foreach
03:32

Infinite loops are dangerous and may make harms to computers and our applications. We should be aware from making a false conditioning inside loops. Usually, infinite loops are used to make some test on a server, and they are scheduled.

Infinite Loops
02:35

From their names, break will help us to break a loop when a certain condition is true, while continue, will take us into next step of the loop when a specific condition is achieved.

Preview 05:07

Switch will help us to take specific values of a variables and set conditions and actions for each one of them. In this lecture, we take a simple example and see why and where we should use switch.

Switch
06:07

Goto will help us to skip some script lines, to execute another portion of the code, when a certain condition is true.

Executing specific script portion
02:07

Basically, require_once() and include_once() will help us to add an external file into our page. But require_once() will stop executing any further PHP lines, if the file contain errors and display them. And include_once() will continue executing PHP lines but it will show us the error.

Require once and include once
03:55

In this lecture, we will learn the and && and the or || operators, which help us to add more conditions inside a loop or an IF statement.

And Or Operators
04:17

In this lecture, we will learn how to declare an indexed array, how to get array size, and how to use a loop to display all values.

Indexed Arrays
04:48

Associative arrays are important when we work with AJAX and JSON. In this lecture, we will learn how to declare them, and display them on screen using foreach() loop.

Associative Arrays
03:43

In this lecture, we will learn how to declare and print multi-dimensional arrays.

Multidimensional Arrays
06:47

They are multiple arrays premade functions to use while working with arrays. In this lecture we will learn how to merge, shift, and push arrays into other variables.

Arrays Premade Functions
04:14

As other languages, we can work with math using PHP premade functions. In this lecture, we will learn some of them.

Math Functions
04:40

In this exercise we will calculate a factorial of a number and use a new function to test if a result is infinite or not.

Exercise 1
05:02

In this exercise, we will create random arrays and fill them with random numbers, and create some discounts on the total sum.

Exercise 2
08:05

In this exercise, we will take a premade script, and make iterations according to loops, and display the final results.

Exercise 3
03:35

In this quiz, we will make a recap, about all programming basics that we had seen in the previous sections.

PHP Basics
10 questions
+
PHP and MySQL
14 Lectures 01:08:24

In this lecture, we will learn how to enable error reporting while we are working offline, designing our web app, and how to set error reporting functions, when we put our work online.

Error Reporting
04:06

In this lecture, we will see in details, each part of our connection strings, and what every single variable means.

Connections
07:14

In this lecture, we will learn how to design databases using MySQL workbench and PHPMyAdmin.

Database Design
11:39

In this lecture, we will learn how to start working with bootstrap classes, to create responsive web applications and websites.

Bootstrap Basics
13:02

Servers only work with HTML name tags. So we should add name tags to each text box, and other HTML elements we have.

Name Tags and PHP server
02:43

In this lecture, we will set up, the working space of our first landing page, which is the login page.

Login Form
02:14

In this lecture, we will learn how to get data from HTML forms, into PHP server, using POST and Get methods. Then, we will walk through the difference between them.

Post and Get methods
02:26

In this lecture, we will learn how to use isset() and !isset() functions to see if a button is clicked, or a variable is set to a value.

Variable set function
02:38

MD5 isn’t a secure encryption method nowadays, to use it with passwords. We will use it for now, and in section 4, we will learn how to encrypt passwords using advanced crypto techniques.

Password Encryption
06:11

In this lecture, we will type our first SQL query and use query() function to run it and get the results. This SQL query is without any parameters and when we use queries with variables, we should use another type of queries like prepare ().

Query Function
05:02

In this lecture, we will see how to add parameters to SQL query, and why the PDO type is better than the old unsecure method where we were adding directly variables into queries and execute them, which get us into big security problems.

Prepared Statements
02:40

In this lecture, we will add our variables, into SQL query using bindValue() or bindParam(). And in this lecture, we will the difference between those 2 functions, but the both will help us to get the same result at the end.

bindValue() and bindParam()
02:30

In this lecture, we will learn how to execute queries using execute() functions, and fetch the result into a new variable using fetch() or fetchAll() functions. Then, we will learn how to check if a row exists in our database, using 2 methods.

Executing Queries
03:12

In this lecture, we will create our first function. We have function that can take parameters, like the example in this lecture.

Functions
02:47
+
Sessions and Cookies
7 Lectures 28:43

In this lecture, we will see the difference between sessions and cookies, and we will start using sessions by checking if their already active one or not.

Introduction
02:53

In this lecture, we will learn how to save user credentials in session. We will learn how to go to next page using header() function after a successful login.

Session Information
03:42

In this lecture, we will create a global connection file and add it in all our pages, using require_once() function.

Connection file and sessions
03:35

In this lecture, we will learn how to create a logout page, and destroy all our session using unset() and session_destroy() functions, and redirect into the login page.

Logout and Destroying session
05:31

In this lecture, we will learn how to create and set cookies, and specify their end-time using setcookie() and time() function.

Cookies
02:27

In this lecture, we will improve password field, and add hashed strings instead of using MD5 encryption. Then, we will use password_verify() to see if a typed password would be the same as the hashed value in our database. This method will help us to increase our security level. At the end, we will learn about var_dump() function, that help us to get all information about a variable or a function.

Securing login system using password hash
04:37

In this lecture, we will learn about more super global variables like $_REQUEST and $_SERVER. We have $_FILES, $GLOBALS and more.

More super global variables
05:58
+
AdminPanel Project
8 Lectures 01:01:13

In this lecture, we will learn SQL query basics, from selecting a specific column, insert new data, updating existing information, delete rows, and create SQL views.

SQL basics
15:16

In this lecture, we will prepare our webpages and add some buttons, before we start programming and selecting data from database into our site.

AdminPanel Interface
03:27

In this lecture, we will see multiple types of returned arrays inside our fetch() and fetchAll() functions. And we will use fetchColumn() if we need to return a specific column of a table.

Fetching Columns
02:01

In this lecture, we will create an HTML table that will get all rows from login table, and we will add text boxes at the end, to add new users.  

Exercise 4 – Adding users
19:21

In this lecture, we will create a delete button for each row we have in our table created in exercise 4.

Exercise 5 – Part 1
06:35

In this lecture, we will create an update button to update user information.

Exercise 5 – Part 2
02:40

In this lecture, we will learn how to get the last inserted ID into any table of our database, using a PHP function called lastInsertId(). We should know where to add this function and after which query, so we can get the correct id.

Last Insert ID
09:23

In this lecture, we will see 2 main types of errors. The first one is PHP error when we have syntax errors. And the second type is when we are handling with database, so it is called PDO Exception error.

PHP Errors
02:30
+
Object Oriented Programming in PHP
14 Lectures 01:05:14

In this lecture, we will learn why we should use OOP in PHP, because it’s reusable, readable, and perfectly fit an advanced PHP based web application project. We will learn some new keywords like: object, class, method, property, and handler.

Introduction
02:27

In this lecture, we will learn how to declare a class. A class is a blueprint of an object.

Classes
02:17

In this lecture, we will learn how to declare a new property for a class. And we will see different restrictions that we can use when we work with properties. Those restrictions can be used by the functions.

Properties and Restrictions
02:28

In this lecture, we will type our first method, and we will use a built-in variable called $this that refer to the current object, and help us to access a property or function in our class.

Methods
02:19

In this lecture, we will learn how to access a function a get a result from it. And we will learn the setter and getter method, where we make changes into a method, and we echo the result inside another method. 

Instantiate Classes
07:05

In this lecture, we will learn how to include a class inside our web pages. Then, we will add a constructor method to our class, to initiate our properties. Construct method is automatically created when a class is executed.

Constructor
03:21

In this lecture, we will solve exercise 6, where we are going to make changes on our procedural script and transform it into object oriented PHP script.

Exercise 6 - OOP Login System
10:31

In this part, we will continue modifying our script, and run it when we click on the login button.

Exercise 6 - Part 2
07:41

Inheritance in OOP is creating a new class that may use methods from another class. To do so, we use the ‘extends’ keyword for this. 

Inheritance
02:27

In this lecture we will solve the exercise 7, where we are going to change the insert procedural script into Object Oriented script.

Exercise 7 - Inheritance
09:55

In this lecture we will learn how to override an existing method of a parent class in the child class. And how to make restrictions on the methods and classes in the parent file.

Overriding and Restrictions
02:41

In this lecture, we will learn about interfaces and abstract classes. The difference between them, and why we use them in our projects.

Interface and Abstract Class
05:14

In this lecture, we will learn how to use a static keyword with a class, method, or a property, and why using static keyword will help us to reduce the amount of resources used, when executing a script.

Static Methods and Properties
05:22

A destructor method helps us to destruct the object created, when execution is done. Usually PHP will automatically create a destructor for each class, but there is no harm from typing a destructor method in each class.

Destructor
01:26
About the Instructor
Eng Ali Mehdy
3.5 Average rating
164 Reviews
2,794 Students
5 Courses
Electrical and Telecommunications Engineer

I am an Electrical, Telecommunications and IT engineer graduate with a Master degree since 2013, with experience in designing software and web apps for telecommunication purposes, designing household electrical schematics and designing electrical panels. I have an advanced experience programming industrial microprocessors PLC. And now I am an Udemy Premium Instructor.