How To Insert Data Into MySQL using PHP | PDO

preview_player
Показать описание
In this video, you will learn how to insert data into a mysql database using PDO in PHP. PDO (PHP Data Objects) is a secure way to connect and execute tasks with the database.

Another advantage of PDO is that it works with a lot of popular databases. So, if at some point of time you want to change the database for your website, you can do that easily by just changing one line of code.

Here we are not using any object oriented way which can help keep code organized for large projects. I recommend you to try adding different tasks in this video to different functions and call the functions whenever necessary.

We are using MySQL database which is mostly used with PHP. We had designed and added validation to the contact form in the previous two videos. Please watch them if you want to know how to create a contact form.

Here are the links:

If you liked this video please give it a thumbs up. Subscribe if you haven't already.

------------------------------------------------------------

Рекомендации по теме
Комментарии
Автор

I search a hell of time to find finally someone explaining this! Thanks, earned a subscriber!

RameenFallschirmjager
Автор

Was referring to a video from 3 years ago that first popped up when I searched on how to do this and that video did not help me at all but when I found this video it all worked after trying 4+ hours to figure it out thank you sir!

louieeee
Автор

Finally a perfect tutorial, BIG THANKS !

alixpro
Автор

Simply you're the best man.... I can't thank you enough.. almost three days trying this.. Anyway thank you you solved my problem

tassiblezilundu
Автор

Straight to the point, thank you so much!!!

bonguthandokhumalo
Автор

This code is actually works, thanks mate

eziochannel
Автор

Thank you so so much I learned a lots <3

Salye
Автор

Is this a part of a playlist or something? Where is the actual form action for example?

Luggruff
Автор

please can i have a link to the video on how you created your form?

Sss-osys
Автор

great job, thank you so much. I tried to add a created_at column with datetime default current_time parameter but the date and the time are not added automatically so I should add them manually. someone can help me to fix this issue.thank you.

najidmouhammad
Автор

Thank you so much, this was cool and what I needed for my project. Subbed!!

SimPwear
Автор

How to check if the insert was successful?

gergoszabo
Автор

I can have your help. it's the first time I use it

ratsitoherinaLogios
Автор

I want to use it with update and edite

ratsitoherinaLogios
Автор

the data does not get inserted bro I know your method is working because I tried it before but now it's not working for me I am using mysql local host database

jalalgang
Автор

i am doing everything just as it is in your code but my javascript is not connecting and my submit button is not no responding appropriately. i use a fujitsu laptop, can that be the reason ?
i am very confused and have no idea what to do next.

MASSDARIO
Автор

White doing the stmt execute lart
My browser ks showing error in execute() showing parameter not defined

ASTekProductions
Автор

hi
How do I enter a text file with only rows

okgo
Автор

sir cod does'nt work, query is not working message displayed message was sent but data is not shown in database? please help me

kashifqureshi
Автор

I would like to know how to insert data into a database when the class is using a composition relationship such as order (table) and itemsOrder (table). Because I can't find any youtube videos explaining this and I need to do a project for college and I don't know how to do it.

mariafantuci