YoVDO

How to Connect a Form to a Database in PHP - PDO Tutorial

Offered By: Dave Gray via YouTube

Tags

PHP Courses Computer Science Courses Web Development Courses MySQL Courses CRUD Operations Courses PDO Courses

Course Description

Overview

Learn how to connect a form to a database using PHP and PDO in this comprehensive tutorial. Explore the process of creating a PHP Data Object (PDO) to establish a connection between PHP forms and a MySQL database, enabling CRUD operations through Select, Insert, Update, and Delete statements. Follow along as the tutorial guides you through importing a sample database, setting up a PDO connection, creating forms, filtering input, executing SQL queries, and handling query results. Discover how to implement update and delete functionality, add confirmation messages, and apply CSS styling to enhance the user interface. While the initial code achieves the goal of connecting forms to a database, the tutorial also mentions a follow-up video that refactors the code using functions and the MVC Design Pattern for improved organization and professionalism.

Syllabus

Intro
A Note About Setup
Importing the World database
Creating the PDO Connection file
Creating the index page forms
Filtering Submitted Form Input
Building and Executing a SQL Select Query in PHP
Building and Executing a SQL Insert Query in PHP
Review the Logical Flow of the Application
Working with the results of the SQL Select Query
Creating the Update and Delete Forms
Reviewing the Logical Flow of the Application again
Creating the delete_record.php file
Creating the update_record.php file
A note about PHP files
Adding a confirmation to the index file
Reviewing the application in the browser
Testing and Debugging!
Adding CSS Styles
Discovering one more issue...and fixing it!
Finishing the CSS styling


Taught by

Dave Gray

Related Courses

Introduction to Functional Programming
Delft University of Technology via edX
Introduction to Office 365 Development and APIs
Microsoft via edX
Web Development and Design using Wordpress
California Institute of the Arts via Kadenze
Build a Basic PHP Website Course (How To)
Treehouse
Web Applications for Everybody
Independent