14- MySQL Update Data


MySQL Update Data

To Update the existing data in MySQL database you need to used UPDATE statement.


UPDATE tablename
SET column1=val1, column2=val2, column3=val3.
WHERE column=value;
Take Note! Using the UPDATE command you must not forget to include the WHERE clause, because the Where clause is used to specify record you want to modify. Without having the WHERE clause, all records in the table will be modified.
Example in Updating Data using MySQLi(Object-Oriented), MySQLi(Procedural) and PDO.

Example using MySQLi(Object-Oriented):


Example using MySQLi(Procedural):


Example using PDO:


 Our Previous Topic Called: 13- MySQL Delete Data

Facebook Comments


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.