SQL UPDATE Statement

0
188

sqltuts

A user can do so by using SQL UPDATE Statement. This will help in modifying any field value of any MySQL table in a given database. There might be a situation when an existing data in a MySQL table needs to be modified.

 

The basic syntax which is used to update the given table

The WHERE clause is used when a user wants to update selected rows in the desired table.

Updating Data from Command Prompt:

This will use SQL UPDATE Statement with WHERE clause to update selected data into MySQL table tutorials_table.

 

Example:

This will update tutorial_name field for a record having tutorial_id as 15.

 

Updating Data Using PHP Script:

SQL UPDATE command can be used with or without WHERE CLAUSE into PHP function mysql_query().

 

This function will itself execute SQL command in the same way as it is executed at mysql> prompt.

Example:

 

Facebook Comments
Previous articlePerform right click using WebDriver
Next articleSQL Delete Statement
Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!

Leave a Reply

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