Posts

Showing posts from September, 2022

How to Insert Data in Database using PHP OOPS Classes and Objects

Image
Insert Data into database using classes and object. Create database and table into you localhost server ( phpmyadmin ) Add fields that you require to insert, i'm doing here users related information name, email, contact, gender, education, address. When you done with table we can work on next step. Create a form inside users.php file where we can get information from user to insert into database. Full Name : Email : Contact no. : Gender : Male   Female Education : Select 10th 12th Graduate Post Graduate Address :   Lets create database connection and class inside functions.php for insert operation and function for insert data into database using mysqli_query. define('DB_HOST','localhost'); define('DB_USER','root'); define('DB_PASS',''); define('DB_NAME','demo'); class dbcon { public $con; public function __construct() { $this->con = mysqli_connect(DB_HOST,DB_USER,DB_P...