PHP – PDO Insert data into database using OOP Concept

I am using PDO – OOP concept for inserting data into database . If you are new to pdo then please learn basics of pdo . I have used simple OOP concept only class for connection and function for executing pdo query .

This is table in db & coulmn names are : id , name , age & email


Please make same table as i have made for you dont change column names otherwise you will get errors & if you want different names then you have to change all coulmn names in php code .

Now if you will run this code in your browser then your output will be this


Please dont use mysql now start using mysqli or pdo

Leave a Reply

Your email address will not be published. Required fields are marked *