Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
PHP Easy Tutorial to Database Connections using a PDO class
Rating: 4.7 out of 5(65 ratings)
1,916 students

PHP Easy Tutorial to Database Connections using a PDO class

What is PDO? A PHP class with functions to make safer database connections.
Created byTony de Araujo
Last updated 12/2023
English

What you'll learn

  • UNDERSTAND what VANILLA PDO functions already do and stop using legacy code that is confusing you.
  • Gain a SOLID FOUNDATION to take other courses involving PHP and database connections.
  • Learn how to practice new code concepts in the world of code automation
  • The minimalist presentation facilitates your reviewing over time

Course content

9 sections53 lectures2h 9m total length
  • How to do the exercises (use 1.25x speed)1:41

    The spiral approach is a technique often used in teaching or textbooks where first the basic facts of a subject are learned, without worrying about details. Then as learning progresses, more and more details are introduced, while at the same time they are related to the basics which are reemphasized many times to help enter them into long-term memory.  Last edit: September 2019.

  • What is PDO? (use 1.25x speed)1:53

    The PDO API needs a specific driver to communicate with a database. Each database system has its own PDO driver to communicate with PHP. Last edit: September 2019.

  • About your development environment0:29

    You can use any PHP development environment you may already have. In his demonstrations, the author uses XAMPP with PHP 7.3, along with the Visual Code editor.

  • Alternative database creation using the terminal1:34
  • Creating a database with phpMyAdmin4:34

    This video shows you how to create a database using phpMyAdmin. The purpose of this database is to have data for testing the PHP 7 script exercises. You may skip this video if you already know how to create a database. You will need a database with 1 table and at least 2 rows with a title and a content column.

  • Practicing exercise 1 - New database0:23

    This is an optional practicing exercise.

Requirements

  • Access to the Internet
  • Familiarity with basic PHP syntax such as variables, functions and loops
  • Some knowledge of HTML is helpful
  • Having a PHP environment setup such as XAMPP if you want to code along
  • The code used in this course is compatible with PHP 7.4 through the latest PHP 8.2.

Description

Why is PDO important?

PDO provides a data-access abstraction layer in PHP, which means that, regardless of what database you're using, you write the same functions to issue queries and fetch data.  It's that simple! However, you still need to set a database-specific PDO driver in your php.ini to access the correct database server.


How is this course different?


  • This is a hands-on project; no fluff or history lessons that you can always search if you're interested.

  • This updated course was originally written in 2019 using PHP 7.3,
    but it has been reviewed in 2024 using PHP 8.2 to assure its integrity.

  • Each section starts with independent code after a brief review of concepts.
    Wash, Rinse, and Repeat.


Upon completion of this project, you should be able to:


  1. Summarize and remember the steps involved in using PHP to accomplish a basic database connection and CRUD.

  2. Have a solid foundation to take other courses involving PHP and database connections, like using Symfony components, for example.

  3. Your PDO training starts here.

The purpose of this short course is to empower you by giving you the basics before you tackle a framework where everything is more abstract. It's a short study project designed to go slow by repeating core exercises.


Why PHP?

In 2025, PHP still powers 76% of websites around the world. PHP has evolved into a powerful, object oriented language. We are not in 2005 anymore.  The job market is wide open for good PHP developers that take time to study fundamentals.


This project informs and teaches; and that is great for reviewing concepts as well.

Add it to your collection of periodic drills you must do to stay current with the basics.

Subscribe today, even if you want to start at a later date.





Who this course is for:

  • Students of other PHP courses who may still want further explanation on using PDO
  • Beginner PHP developers with some previous knowledge of syntax
  • Intermediate web developers wanting to learn more about the PHP 7 PDO class
  • Database SQL users who want to learn how to connect by using modern PHP techniques
  • Researchers who are interested in PHP database connectivity
  • Anyone who wants to know how to connect a MYSQL database to HTML