Insert and Retrieve data from database in PHP using MySQLI

What is Mysqli:-
The Mysqli extension, or as it is used before this name the MYSQL and update extension, was developed to take advantage of new features found in Mysqli systems versions 4.1.3 and now. The Mysqli extension is included with PHP versions 5 and now. Mysqli Supports only Mysql Database.

Mysqyli advantage:-

  • Object-oriented interface
  • Support for Transactions
  • Support for Multiple Satatements
  • Support for Prepared Statements

Step- 1
First, install XAMPP and run in local server.

Step – 2
First Go to in localhost/PHPMyAdmin local server and click New and create Database and after create a table. In the database to easily handled by the user and user easily create, update, and delete any data from the database.

Step – 3
Go to (C drive of Pc) and open xampp folder and go to htdocx and create a new folder as you wish. And open it create a new file and his name will be .php file extension.

Step- 4
After step 3 creating a sample form as index.php and edit in HTML form as below:-

Step – 5
After step 4 then create a new PHP file as you wish and fill as below for add to the database and connect to the table-:

Here,
‘name’ = from index form
’email’ = from index form
‘mobile’ = from index form
‘localhost’ = server name
‘root’ = user name
‘ ‘ = password defalut
‘school-db’ = database name
mysqli_connect = database connection
mysqli_query = return query

$qyery = You can select from database before go database table and click SQL and after click insert button then copy query in screen and select. This is right way.

Rajesh Kumar
Follow me