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

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. T...

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 Redundan...

What Is PHP ??

  PHP is a best Language of Website Development. There are many country and colleges are accepted php language. php in many library and function are used. That main language of website development php starting simple syntax and example. so start in few days to learn php.   to generate any system and dynamic working are possible throw a php.  there are following keyword of php.