Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
PHP with PDO - ULTIMATE Crash Course
Rating: 4.7 out of 5(507 ratings)
2,561 students

PHP with PDO - ULTIMATE Crash Course

Learn PHP Data Object Objects or PDO and make better secured database queries.
Last updated 1/2022
English
English [Auto],

What you'll learn

  • Learn to use PDO with PHP to build more secured applications
  • Students will learn how to use PDO with PHP and MySQL

Course content

1 section19 lectures1h 31m total length
  • Introduction1:27

    Join this PHP with PDO - ultimate crash course and access continuous instructor support, answering your questions across time zones, as thousands of students learn and grow.

  • Editors, Video Quality and Udemy Interface Walk Through8:54

    Explore the Udemy interface and learn how to adjust video quality, captions, transcripts, and playback controls. Discover course resources, notes, Q&A, and announcements that enhance your learning experience.

  • Update - Editors I recommend0:37
  • Creating Database, table and data4:18

    Create a MySQL database and a users table, define fields like id, first name, username and email, and insert sample data to practice PHP with PDO.

  • Connecting6:27

    Connect PHP applications to databases using PDO with a driver-based, object-oriented approach. Construct the connection string by specifying the driver, host, database name, port, and credentials.

  • Catching errors6:14

    Learn to handle database errors with try and catch, catch exceptions, and display safe messages; discover available PDO drivers like MySQL and how to connect using a predefined configuration.

  • Reading data / Fetching7:33

    Learn how to retrieve data from a database using PHP with PDO, fetch as associative arrays or as objects, and access user fields like id, username, and first_name.

  • Reading all data / Fetching4:28

    Pull all rows from the database with a simple PHP PDO query, compare fetch and fetching all, then loop with foreach to access fields as objects or associative arrays.

  • Prepare statement part 18:37

    Learn how to save data securely with PDO prepared statements, using named placeholders or question marks, binding values from requests, and preventing SQL injection.

  • Prepare statement part 2 - different placeholder3:38

    Learn how to use PHP with PDO prepared statements using question mark placeholders, binding parameters for first name and password, and executing queries securely.

  • Binding values3:33

    Bind placeholders with actual data using prepared statements in php with pdo, demonstrating how to bind values before executing, handling single or multiple values from get, post, or hard-coded data.

  • Complex binding6:27

    Explore complex binding in PHP with PDO using the like operator for flexible search patterns, including starts with and ends with, and learn how to bind wildcards with prepared statements.

  • Bind params feature2:47

    Explore bind params in PHP PDO to modify a bound value before execution; binding works by reference, updating the parameter reference without changing the original variable.

  • Manually escaping data3:20

    Learn how to manually escape data in PHP with PDO using the quote method, before executing a simple non-prepared query, to safely fetch a user.

  • Updating data3:53

    Update a user's first name in the database with PHP PDO via a prepared statement and placeholder. Delete data with same approach and verify changes via a browser get request.

  • deleting and inserting data5:26

    Execute delete and insert operations on user data using SQL statements, including fields like first name, user name, email, active, and password.

  • Counting table rows1:57

    Count the rows in the users table by running a select query and using the roll count method, then verify the result as you add records.

  • Last inserted id, insertion and update4:54

    Learn how to insert a record with PDO, retrieve the last insert id, and immediately update that same record to toggle its active status.

  • Affected rows6:36

    Learn how affected rows reflect updates, selections, and deletions in a database using PHP with PDO, including checking rowCount and verifying changes in the browser.

Requirements

  • A little basic understanding of OOP in PHP will be good but not required to follow the course
  • Basic MySQL knowledge

Description

PDO is the best way to access databases in PHP among other web programming languages. PDO is not database specific, so we can use it to connect and control data for a very broad selection of databases. PDO is most  secured and easy way to access any database.

PDO stands for PHP Data Objects and a little Object Oriented Programming understanding is necessary but not required to follow the course.


The awesome thing about PDO is that because it offers data-access abstraction you can use the same functions to create, read, update and delete with any database you choose. PDO doesn't replace SQL or rewrites it but it adds features that are not accessible any other way.


If I am writing an application from scratch on PHP, I mostly use PDO to handle my queries since sometimes I like to switch databases and it would be a hassle to rewrite the API for manipulating data in each database, OUCH.


In this course you will learn how to use PDO to Create, read, update, delete data from any database and lots more.

The best thing about this course is that it goes right to the point and it doesn't waste much time on trivial matters.

If you are ready to get started learning how to use PDO with PHP, lets go......

Who this course is for:

  • Any student looking for better secured way to access PHP databases
  • Students who want a better solution to prevent SQL injection
  • Studens with some basic knowledge of PHP