PHP - PDO Insert data into database using OOP Concept - Web Development

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

idnameageemail
1bobby39[email protected]
2harsh33[email protected]
3nimesj23[email protected]
4aftab12[email protected]

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

idnameageemail
1bobby39[email protected]
2harsh33[email protected]
3nimesj23[email protected]
4aftab12[email protected]
5Robert Venda31[email protected]

Please dont use mysql now start using mysqli or pdo

Leave a Reply

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