Save HTML Form Data to a MySQL Database using PHP

preview_player
Показать описание
Learn how to create a form in HTML, then save the data from that form to a MySQL database using PHP.

Recommended hosting:

In this video you'll learn how to:
- create a form in HTML using best practices
- create form controls for simple text input
- use multi-line text input using the textarea element
- use select lists, radio buttons and checkboxes
- process the submitted form data using PHP
- validate the form data using filter functions
- avoid an SQL injection attack
- use a prepared statement to insert a new record into a database
- create a database and table using phpMyAdmin
- use an SQL INSERT INTO statement to insert a record

Code shown in the video:

Relevant documentation:

00:00 Introduction
00:15 Create the HTML file
01:09 Simple text input
01:38 Labels
02:34 Textarea
03:19 Styling with CSS
04:19 Lists
05:49 Radio buttons
07:36 Fieldset
08:34 Checkbox
09:28 Create the PHP file
11:47 Get the form data
12:55 Filter the data
15:04 Validate the data
16:00 Create the database
16:12 Create the table
17:08 Connect from PHP
19:50 Write the SQL
20:32 SQL injection attack
21:00 Prepared statement
22:08 Bind values to placeholders
23:42 Insert the data
24:06 Summary

#HTML #PHP #MySQL #forms
Рекомендации по теме
Комментарии
Автор

What do you find most challenging about working with HTML forms and PHP?

dave-hollingworth
Автор

This channel deserved more than 8k+ subscribers, hopefully you will not get tired in continuing in sharing your knowledge with us Dave. Blessed you. more power. ❤

dryandave
Автор

Thanks Dave! I'm really impressed how you lecture. You find the right time to explain a concept or parameter. Well done!

antoniopango
Автор

This video helped me so much! Thank You! I watched so many other videos trying to figure out this topic and you were the first to explain it well enough and show exactly how to complete the steps.

emilym
Автор

Thank you soooo much for this video. I was literally struggling to complete my project based on a similar concept. I referred to 10+ websites and other videos but i finally understood how to actually do this after watching your video. SO a big thank you. Please keep helping people

rajashreejarande
Автор

Usually I need to watch 5 tutorials do be able to do something, you managed to make everything working well on the first try, many thanks for your help

jchuillier
Автор

Dave is an amazing teacher and Masters PHP, I took one of His courses in Udemy and it was one of the best courses I have ever taken.

someutubchannel
Автор

Thanks Dave
I was able to understand and returned back in html, php & sql coding again.

yherair-jkqh
Автор

Your content is a life saver. It's really difficult to find content where it takes you step by step process with a good explainaton. after tons searching I found this gold mine :)

porshkabir
Автор

Clear Explanation so I can follow your instruction with no error!
Thankyou Dave

CodeLaniakea-tfno
Автор

Hi Dave, I am new to PHP and have tried about a dozen different videos but could not get the data from my registration form to populate into my database. Your the first one that I had success. I also learned a lot while I was following along. I hope you decide to do a tutorial on designing a membership login system. Keep up the great work and I appreciate you taking the time to do this video.

earlpatterson
Автор

Hey, I just watched this video and this was quite helpful to me, Thanks Man.
Im gonna check all your videos. Love you man. Your discription was way good and understandable.

novabunny
Автор

Dave is reference when we discuss about tests, his courses in Udemy are impressive due quality and good modern/up-to-date approaches, principally those about tests using testing framework as phpunit. thank you Dave for always are doing the best for PHP community.

matheusvieirabloise
Автор

Thank you Dave!
You helped me to understand the part that i dont understand to make my coursework :)
I wish you everything good in life :)

FebryanIbadurrahman
Автор

You are a great teacher my friend! Good moderate pace and very well explained.

hinglemcdingleberry
Автор

Thank you very much seriously.
Simple, focused, and powerful.

nadergad
Автор

This is amazing clear nice speed and amazing as usual i really enjoy every one you do.
Thank you for you work on these !

gensys
Автор

Excellent video, the best explanation I've had, thank you.

orlignegron
Автор

Excellect video with minute details. Thanks so much for uploading this video. I am sure I will be watching more of your videos

ravichandrasangam
Автор

Amazing Tutorial, absolutely life saver!

TradingToolkit