Performing DataBase Operations in XAMPP
Last Updated :
26 Nov, 2020
XAMPP is a cross-platform web server used to develop and test programs on a local server. It is developed and managed by Apache Friends and is open-source. It has an Apache HTTP Server, MariaDB, and interpreter for 11 different programming languages like Perl and PHP. XAMPP Stands for cross-platform, Apache, MySQL, PHP, and Perl.
- It allows you to build a website on a local web server on your computer.
- Stores data locally
In this article, we are going to perform Database operations like Create, Insert, Update, Delete data from the database created in XAMPP localhost server. We are also going to create a table and then start performing database operations. Following are the list of database operations with their respective syntax:
SELECT statement
It is used to display all the details from the table.
Syntax: SELECT * FROM 'table_name'
INSERT statement
It is used to insert data into the table.
Syntax: INSERT INTO `table_name`(`col`, `col2`, `col3`,.. `coln`) VALUES ([value-1],[value-2],
[value-3],....,[value-n)
Update statement
It is used to change/update any data in the table.
Syntax: UPDATE `table_name` SET `col1`=[value-1],
`col2`=[value-2],
`col3`=[value-3],
`coln`=[value-n] WHERE 1
Delete statement
It is used to delete data from a table.
Syntax: DELETE FROM table_name where col="value"
Procedure:
Follow the below steps to perform database operations on XAMPP:
- Start XAMPP Server
- Create Database and Create Table
- Perform Database Operations
- Verify Resultant Table
Steps to Create a Database:
1. Start XAMPP server
2. Go to Browser and type "http://localhost/phpmyadmin" and Create a database with the name "Vignan" by selecting new

3. After that, Create table Name "ITDept" and give the number of columns (I created 4 columns) and click on Go
Give column names as "Rollno"(Varchar), "Name"(Varchar), "Gender" (Char), "Address"(Varchar), and Save.
Note: Clicking the "Save" option is important, if not the table is not created.
Then we get the output as:
Performing SQL Operations:
INSERT Operation:
By default, code is available like this:
INSERT INTO `itdept`(`Rollno`, `Name`, `Gender`, `Address`)
VALUES ([value-1],[value-2],[value-3],[value-4])
- We want to modify the values as follows and click on "GO"
INSERT INTO `itdept`(`Rollno`, `Name`, `Gender`, `Address`)
VALUES ("171FA07058","Sravan Kumar Gottumukkala", "m", "HYD" )
Output:
- Now insert 5 records. Data in the database is as follows:
UPDATE Operation:
Default code in the update is:
UPDATE `itdept` SET `Rollno`=[value-1],
`Name`=[value-2],
`Gender`=[value-3],
`Address`=[value-4] WHERE 1
- Now change the name to Sujatha where rollno is 171FA07078 as follows:
UPDATE `itdept` SET NAME="Sujitha" WHERE `Rollno`="171FA07078"
Output:
SELECT Operation:
The Select statement is used to display or query for data from the database. Follow the below steps to do so:
- Click on the Select* option
This will result in the following code generation:
SELECT * FROM `itdept`
Output:
For Selecting particular data follow the below sample query:
Select Rollno, Name from itept

DELETE Operation:
- Click on the Delete button to delete the data as shown below:
The generated code would look like below:
DELETE FROM itdept where Rollno="171FA07058"
- Confirm the deletion by clicking YES
Output:
Our Final data in Table is:
Similar Reads
PHP | Inserting into MySQL database
Inserting data into a MySQL database using PHP is a crucial operation for many web applications. This process allows developers to dynamically manage and store data, whether it be user inputs, content management, or other data-driven tasks. In this article, We will learn about How to Inserting into
6 min read
PHP | MySQL Database Introduction
What is MySQL? MySQL is an open-source relational database management system (RDBMS). It is the most popular database system used with PHP. MySQL is developed, distributed, and supported by Oracle Corporation. The data in a MySQL database are stored in tables which consists of columns and rows.MySQL
4 min read
PHP base_convert( ) Math Function
The base_convert() function in PHP is used to convert a number given in an arbitrary base to a desired base. Both the base should be between 2 and 32 and bases with digits greater than 10 are represented with letters a-z i.e 10 is represented as a, 11 is represented as b and 35 is represented as z.
2 min read
PHP - MYSQL : sum() operation
Problem Statement: In this article, we are going to perform sum() aggregate operation on our database using PHP with xampp server. So we are considering the food_order database and perform database sum() operation. Requirements: xampp Introduction: PHP stands for hypertext preprocessor which is a se
3 min read
PHP | Decision Making
Decision-making is an important part of programming, allowing the program to execute different actions based on conditions. In PHP, decision-making helps control the flow of a program by executing different blocks of code depending on certain conditions or expressions. PHP provides several construct
5 min read
CRUD Operations in MySQL
As we know that we can use MySQL to use Structure Query Language to store the data in the form of RDBMS. SQL is the most popular language for adding, accessing, and managing content in a database. It is most noted for its quick processing, proven reliability, ease, and flexibility of use. The applic
3 min read
Perl | Operators | Set - 1
Operators are the main building block of any programming language. Operators allow the programmer to perform different kinds of operations on operands. In Perl, operators symbols will be different for different kind of operands(like scalars and string). Operators Can be categorized based upon their
12 min read
PHP | Imploding and Exploding
Imploding and Exploding are couple of important functions of PHP that can be applied on strings or arrays. PHP provides us with two important builtin functions implode() and explode() to perform these operations. As the name suggests Implode/implode() method joins array elements with a string segmen
3 min read
Concatenation of two strings in PHP
In this article, we will concatenate two strings in PHP. There are two string operators. The first is the concatenation operator ('.'), which returns the concatenation of its right and left arguments. The second is the concatenating assignment operator ('.='), which appends the argument on the right
2 min read
PHP Operators
In PHP, operators are special symbols used to perform operations on variables and values. Operators help you perform a variety of tasks, such as mathematical calculations, string manipulations, logical comparisons, and more. Understanding operators is essential for writing effective and efficient PH
8 min read