UPDATE tutorial in php

 UPDATE Syntax :

UPDATE table_name SET column1_name = value1, column2_name = value2,...WHERE condition;


If we want to UPDATE any record from table name "personal" using UPDATE then we can use below sql query :

UPDATE personal SET city = "Ahmedabad" WHERE id = 3;


If we want to UPDATE multiple column record using single query using UPDATE from table name "personal" then we can use below sql query :

UPDATE personal SET city = "Rajkot", age = 20 WHERE id = 9;


If we want to UPDATE multiple Row record using single query using UPDATE from table name "personal" then we can use below sql query :

UPDATE personal SET age = 18 WHERE id IN (3,4);

Comments

Popular posts from this blog

Logical_Operators

SubQuery with EXISTS and NOT EXISTS in PHP

Get Functions