How to Insert Data in Database using PHP OOPS Concept

This is an explanation on how to insert data in database using oops concept.

Below are step by step procedure on how to do this simple process.

you will need a text editor like notepad++

localhost servers




a working pc

1.First create a html form

2. Create a database with name demos Inside demos data base create a table inserdata Sample Structure of insertdata table

3. Create a php page function .php 
Inside this page a class DB_con define. Db_con class contain db connection and insert funtion.
function .php

4.Define a object and class the insert function Put this code at the top of the index.php page


Related Post

19 Replies to “How to Insert Data in Database using PHP OOPS Concept

    1. am glad you find it informative, thanks for sharing. we look forward to hearing from you sometimes soon

  1. This looks very complicated, I have never touched my website’s data base. I would always hire a developer if there is something wrong or if I need something changed on my website that needs programming.

    1. well those doing the job for you are not smarter than you, they just gave in little more time to doing it, meaning you can also do it only time and determination is required. am glad you stopped by.

  2. I have not done any coding since I was in university, and I was really bad at it. I would love to have seen the final result of all the coding and data tables that you inserted .

  3. My best friend and her husband are BOTH Web Designers. I feel like it is a talent that NOT all people have or can do. I look at it like , ummm “no, I can’t.” How did you get into your field?

    1. well it started with passion for coding, once the passion is there, u need one thing persistence, then you are good to go. it never too late to do anything as long as you have breath.

Leave a Reply

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