PHP PDO Tutorial Part 1 - Prepared Statements - SQL Injection - Full PHP 8 Tutorial @ProgramWithGio
PHP PDO Tutorial Part 1 - Prepared Statements - SQL Injection - Full PHP 8 Tutorial  @ProgramWithGio
Uploaded July 2021 | Updated November 2026, 3 hours ago
In this lesson, you will learn how to connect to the database from PHP using PHP Data Objects or in short PDO. PDO provides data access layer abstraction where common methods can be used to interact with different databases like MySQL, SQLite, and so on. You will learn about prepared statements, what SQL injection is & how it works, how to prevent SQL injection, learn about the difference between binding params by value or by reference, the difference between placeholders & named parameters, emulated prepares & so on.

NOTE: If you have concerns/questions about 15:28 please watch the beginning of Part 2 of the PDO lesson, I address & explain there. This is just a debug query & to save an extra line I decided to pass an integer directly to the query. I don't recommend you do that, even though this particular example has no SQL Injection vulnerability, someone might make a mistake & introduce the vulnerability. youtube.com/watch?v=e6yLUvpcOZo

SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
πŸ‘ Smash the like button
🀝 Subscribe to the channel & turn the notifications on
πŸ’¬ Post comments, any feedback is greatly appreciated
⭐ Become a Patreon: patreon.com/programwithgio
THANK YOU!

LESSON 2.30
Course Outline - github.com/ggelashvili/learnphptherightway-outline
Course Playlist - youtube.com/playlist?list=PLr3d3QYzkw2xabQRUpcZ_IBk9W50M9pe-

RESOURCES
php.net/manual/en/book.pdo.php
php.net/manual/en/pdo.connections.php
php.net/manual/en/pdo.error-handling.php
php.net/manual/en/class.pdo.php
php.net/manual/en/class.pdostatement.php
php.net/manual/en/pdo.constants.php
php.net/manual/en/ref.pdo-mysql.php
github.com/php/php-src/blob/master/ext/pdo/pdo_stmt.c#L319

CHAPTERS
00:00 - Intro
01:12 - Install/enable PDO MySQL
02:45 - PDO connection
05:52 - Error modes
06:34 - Run queries & fetch data
07:36 - Fetch modes
09:14 - Prepared statements & SQL injection
10:12 - SQL injection example
13:43 - Placeholders, named parameters & the difference between them
18:03 - Bind parameters using bindValue & bindParam
22:18 - Emulated prepares
PHP PDO Tutorial Part 1 - Prepared Statements - SQL Injection - Full PHP 8 TutorialLets Build Task Tracker App With Laravel | Part 3: Dashboard, Refactoring, Code Quality & SecurityPHP Generators Explained - Full PHP 8 TutorialDisplay Validation Errors & Keep Form Filled - Build Expense Tracker App With PHP 8How to authenticate Mobile App using Laravel Sanctum & Laravel FortifyBasic Apache Webserver Configuration & Virtual Hosts - Full PHP 8 TutorialPHP Variable Storage & Object Comparison - Zend Value (zval) - Full PHP 8 TutorialPHP WeakMap Explained - Full PHP 8 TutorialPHP Anonymous Classes - Full PHP 8 TutorialBuild a Transactions Page Using Raw SQL in Laravel | Learn Laravel The Right Way
Program With Gio |

PHP PDO Tutorial Part 1 - Prepared Statements - SQL Injection - Full PHP 8 Tutorial

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER