This six-minute video shows how I created a table and then inserted data from an HTML form into MySQL.
Links for Inserting Data Into MySQL
Reference pages from the MySQL manual on creating a table:
Previous videos on PHP with HTML forms:
- Using PHP with HTML Forms
- Security Issues with Superglobals and register_globals
- Functions for Form Input Security – This also includes info about magic quotes.
Inserting data into MySQL:
- mysql_real_escape_string – Lots of info about this function from the PHP manual.
- PHP MySQL Insert Into – Info on the
INSERT INTOstatement from the W3Schools site.
I did some research on MySQL security issues, and man, did that give me a headache! I’ll have to get back to that one day — but hopefully not for a very long time.

When data is put into a MySQL table it is referred to as inserting data. When inserting data it is important to remember the exact names and types of the table’s columns. If you try to place a 500 word essay into a column that only accepts integers of size three, you will end up with a nasty error!
I am amazed in your article. This is a great guide for me. I got an idea from this. I am looking forward for the updates of this post.
Hi – I know exactly what you mean when you say:
“I did some research on MySQL security issues, and man, did that give me a headache!”
I have been using MYSQL with web forms for a while now and the potential for security holes is frightening. The biggest problem is usually sql injection where users try and submit your form with malicious database code (e.g. drop * from database) and you accidently run the injected code on your server.
Nice job on the video – I’m sure it will be really useful to some people who are new to databases and html forms.
Albie Skinner,
webmaster: Diy blog – Paslode Framing Nailer
I have learned very easily by watching this short movie about how i can connect my Mysql database with my html web form. I am a beginner of php+mysql this was a very useful information for me. Thanks for sharing this video and i hope you will also provide some advanced lectures on PHP+MySQL in future.
Pingback: MySQL is a Little Horror Sometimes | Only The Cool Stuff
Thanks for sharing PHP and MySQL to us. I am learning already. I have basic PHP and I want to learn more specially data base. Connecting data base, MySQL and PHP is very important for me. It relates me to my job.
Peter
LN, Philippines
Webmaster, FoodDehydrator.biz
Food Dehydrator
I’m having constant problems with MySQL, now I’m so lucky to have found this. Thanks for your effort for making the video.
Jake Boyd
Bartlesville, OK
http://trailersexpert.com/
I try to use PHPmyadmin for most of my interaction with Mysql databases but this tutorial can be helpful.
Thanks!
I am also a beginner looking to understand and use Mysql databases with blog forms. Your short video was helpful and I will come back here to see other functions I can learn from you.
It reminds me of MU Game those old days where you can insert mysql into their login forms (tweak / hack)
Greg of Brisbane
visit us:
Hypnotherapy Brisbane
Your post has really made the whole mySQL/database thing a lot clearer for me. I have been in the throws of migrating my wordpress blogs from one host to another and was finding the process complicated. Thanks for taking the time to post.
Brent M
Auckland, NZ.
Green Lipped Mussel Guide
Anyone who knows how to program databases are going to have jobs in the future. It’s such a good idea to learn as much of this technology as possible, it truly is the wave of the future. Thanks for sharing.
MySQL was a bit of a mystery until I saw your video. Now I’m ready to get a bit more serious in its use. Good stuff. Thanks.
I’m actually having to teach a complete newb at work the basics of PHP and SQL. He’s got some idea but is way behind… and it turns out I’m a terrible teacher!! I needed to get back to basics, and now I’ve found your blog I will be pointing him here rather than pulling my hair out!
Thanks a lot
Brett
I’ve had the hardest of time understanding the workings of MYSQL. This video was very easy to understand and will definitely be recommending this video to others needing a more simpler explanation.
Larry
Houston, TX
How do you get rid of bed bugs
?
Up until now there are time that I deal issues with MySQL and really get totally clueless on what to do. I hope this post could get me some solution.
Benney Kent
Tampa, FL