Category Archives: PHP

PHP – For C Developers

There are many similarities and differences that both languages possess. Below are some points that you can consider working with these languages. Similarities Syntax: It is most of the PHP syntax is similar to C, which includes- Code is blank space insensitive, semicolons are used to terminate the statements, PHP has the same function calls structure as in C,… Read More »

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 »

PHP and XML

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 »

PHP and AJAX

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 »

Deleting Data from within the Database using PHP

You can delete data from the database using delete command within the mysql_query function. Example: <html> <head> <title>Deleting a Record from Database</title> </head> <body> <?php if(isset($_POST[‘delete’])) { $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()); } $stu_id = $_POST[‘stu_id’]; $db_sql = “DELETE from… 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 »