Skip to main content

How To Insert, Update, Delete Record on Mysql Database In PHP

 


1.Insert Query

$sql = "INSERT INTO persons (first_name, last_name, email) VALUES           ('Peter', 'Parker', 'peterparker@mail.com')";

if(mysqli_query($link, $sql)){ echo "Records inserted successfully."; } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); }

3.Update Query

$sql = "UPDATE persons SET email='peterparker_new@mail.com' WHERE id=1"; if(mysqli_query($link, $sql)){ echo "Records were updated successfully."; } else { echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); }

3.Delete Query

$sql = "DELETE FROM persons WHERE first_name='John'"; if(mysqli_query($link, $sql)){ echo "Records were deleted successfully."; } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); }



* ADVANTAGES OF DATABASE MANAGEMENT SYSTEM  *


2.    Sharing data  :

A database allows the  sharing of data under  its control by any number of application programs or users

3.    Consistency of  data  :

The reduced data redundancy minimizes the presence of the same data in different files which will lead to consistency of data .

4.    Flexibility of  file  system  :

In a database approach, the database is designed based on bottom up approach which ensures that the end users have all the reports. As and when some changes in reports requirements occur. Corresponding revision of the database can be done with minor changes in the database.

5.     Better Enforcement of standards  :

Since different files of the database are designed at a time, there will be better enforcement of standards in terms of defining filed names, filed width, filed type etc. 


Comments

Popular posts from this blog

How to Download Crack version of PUBG ?

  * There are Three Schema Architecture of Download PUBG.   DBMS is a collection of interrelated files and a set of programs that allow several users to access and modify these files. A major purpose of a database system is to provide users with an abstract view of the data. That is tha system hides certain details of how tha   data is stored and maintained. However , in order for tha system to be usable, data must be retrieved efficiently.        Tha concern for efficiency leads to the design of complex data structure for tha representation of data in tha database. However since database systems are often used by non computer   professionals,   this complexity must be hidden from   database system   users. This is done by defining levels of abstraction   at which tha database may be viewed. There is logical or external view, conceptual view and internal view or physical view. The three levels of the architecture are three different views of the data.      1.  External  -  individual

Download PHP Full Source Code Free Template. How to Download Free Responsive Website Templates

  * Important Note To Download Templates * 1. Conceptual Simplicity :  As the information is represented in form of tree structure, it is easy to view, understand, and retrieve the data. This helps the database designer to obtain conceptual clarity of relationship.  2.. Database security :  Security is provided by DBMS. Thus Programming effort is decreased as compared to file system in which programmer has to write the programs for implementing security.  3. Data independence :  If changes are made in design of database, DBMS takes care of cascading it throughout the system. There is no need to make change in system. * Limitation of Download Templates * 1. Complexity :  To implement the database using hierarchical model. programmer needs to have detailed knowledge of how the data is’ stored has to traverse entire tree for the same.  2. Data Redundancy :  To implement many to many ‘relationships amongst data repeatition of data is required. This leads to increased data red  3. Anomali

Advantage and Disadvantage Of PHP Limitation of PHP

               *  ADVANTAGE OF PHP HIERARCHICAL DATATABLE MODELS * 1. Conceptual Simplicity :  As the information is represented in form of tree structure, it is easy to view, understand, and retrieve the data. This helps the database designer to obtain conceptual clarity of relationship.  2.. Database security :  Security is provided by DBMS. Thus Programming effort is decreased  compared to file system in which programmer has to write the programs for implementing security.  3. Data independence :  If changes are made in design of database, DBMS takes care of cascading it throughout the system. There is no need to make change in system.  * DISADVANTAGE OF PHP HIERARCHICAL DATABASE MODELS  * 1. Complexity :  To implement the database using hierarchical model. programmer needs to have detailed knowledge of how the data is’ stored has to traverse entire tree for the same.  2. Data Redundancy :  To implement many to many ‘relationships amongst data repetition of data is required. This le