Tag Archives: PHP

PHP Object Oriented

PHP supports the same OOPS concept as any other language like Java, C++, etc which allows it to build complex and reusable web applications. Some of the below OOPS concepts are explained in PHP. Class Object Inheritance Polymorphism Overloading Data abstraction constructor Destructor 1. Defining classes in PHP A class can be considered as the user-defined data type… Read More »


XML (extensible markup language) works similarly to HTML with opening and closing tags. You can store and transfer data from one system to another using XML. You can create customized tags that are not possible in HTML. XML uses the DOM model to access and manipulate the XML data. The XML code can be converted to the XML… Read More »


What is AJAX? You can unleash the great features bu using AJAX with PHP. AJAX (asynchronous javascript and XML) is a method that reduces client and server interactions by updating a part of the webpage instead of the whole page. AJAX allows the exchange of data without the page being refreshed. Javascript is a client-side language that is… Read More »

Backing up the database using PHP

Backing up data will help you to keep your data safe in case of any failure and you can retrieve data from the backup file any time you lost your data. PHP allows you to create a backup of the database in three different ways. Using SQL command Using binary mysqldump Using the phpMyAdmin user interface Using SQL… Read More »

Updating Data within the Database Using PHP

If you want to update any record within the table of the database then you can make use of the mysql_query function and use the update command.  You can use any query using the mysql_query function and solve your purpose. Example:  <?php         if(isset($_POST[‘update’])) {  $db_host = ‘localhost:3036’;   $db_user = ‘root’;   $db_pass = ‘rootpassword’;   $db_conn = mysql_connect($db_host, $db_user, $db_pass);… Read More »

Using Paging via PHP

Whenever we fetch data from the database, we are nor sure about the amount of record that is present there. We need to manage the record so that it would not look messy and should be handled in an appropriate way. So we have to divide the records to be displayed per page that’s where we use the… Read More »

PHP – Inserting the Data to the Database

Inserting data to the database is the same process as creating or deleting the database. You can use the same function mysql_query to add the data to the table. Example- <?php $db_host = ‘localhost:3036’; $db_user = ‘root’; $db_pass = ‘rootpassword’; $db_conn = mysql_connect($db_host, $db_user, $db_pass); if(! $db_conn ) { die(‘Connection failed: ‘ . mysql_error()); } echo ‘Success’; $db_sql… Read More »

Creating a Database using PHP

Creating Database PHP allows the use of mysql_query function to create a database. But in order to create and delete a database, you must have admin rights on the database. This function takes two parameters to create a database. Syntax bool mysql_query (sql, connection); Where, SQL is the query with which you will create the database. Connection (optional)… Read More »


Well, PHP has support for almost every database like oracle, Sybase but developers mostly prefer MySQL database over others. Before starting with the programming we need to have some pre-requisite for the database part. You should have downloaded the compatible version of MySQL for your PHP. Create a database that will store your PHP data and connect with… Read More »