How to Insert Data in Databse using PHP OOPS Concept

7378 3

In this post i will explain how to insert data in database using oops concept.

      

1.First create a html form
Index.php

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 oject and class the insert funtion
Put this code at the top of the index.php page

      

 

Comments

comments

In this article


Join the Conversation

  • Sonam Singh

    I have go through lots of personal blogs together with completed many websites,however your work is undoubtedly brilliant.Caps off with your determination together with credibility.Do hold us advised in future as well.

  • rahul

    Saved as a favorite, I really like your web site!

    • Anuj kumar

      Thank you !