Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Save HTML Form Data to a MySQL Database Using PHP

Dave Hollingworth via YouTube

Overview

Learn how to create an HTML form and save its data to a MySQL database using PHP in this comprehensive 25-minute tutorial. Create form controls for text input, multi-line text areas, select lists, radio buttons, and checkboxes while following best practices. Process and validate submitted form data using PHP filter functions, and protect against SQL injection attacks with prepared statements. Set up a database and table using phpMyAdmin, then use SQL INSERT INTO statements to add new records. Gain practical skills in web development, database management, and secure coding practices through step-by-step instructions and real-world examples.

Syllabus

Introduction
Create the HTML file
Simple text input
Labels
Textarea
Styling with CSS
Lists
Radio buttons
Fieldset
Checkbox
Create the PHP file
Get the form data
Filter the data
Validate the data
Create the database
Create the table
Connect from PHP
Write the SQL
SQL injection attack
Prepared statement
Bind values to placeholders
Insert the data
Summary

Taught by

Dave Hollingworth

Reviews

Start your review of Save HTML Form Data to a MySQL Database Using PHP

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.