SQL UPDATE Statement

UPDATE statement is used to edit the records of a table.

with WHERE

Syntax
<?php  

    UPDATE table_name
	SET column1 = value1, column2 = value2, ...
	WHERE condition;

?>


Example
<?php  

    UPDATE Customers
	SET CustomerName = 'john', City= 'Austria'
	WHERE CustomerID = 6;

?>

without WHERE

Whenever we use UPDATE Statement without WHERE clause with it, all the records update.

Syntax
<?php  

    UPDATE table_name
	SET column1 = value1, column2 = value2...;

?>


Example
<?php  

    UPDATE Customers
	SET CustomerName='john';

?>