How to Update Data in MySQL

Once you’ve inserted data into your MySQL tables, you’re going to have to change it at one point.

The type of query that you use to update data is called an UPDATE query. It is used to change the values in rows that already exist. The syntax for the query is as follows:

{code type=sql}UPDATE table_name SET table_column = value, … WHERE table_column = value{/code}

Again, the first parameter table_name is fairly self-explanatory. The next two sections behave a little bit like an INSERT query in that the values that you are using have to be properly quoted in order for the query to run. The first of these is all of the data that you are updating in the MySQL database. The second is the parameters that tell the query where to update the values. This is optional. Without it, the query will set the values for every row in the table.

That’s pretty much all that you need to know about MySQL query updates. If you have any questions, please leave a comment!


Leave a Reply

Your email address will not be published.

More Posts

How to use PHP Type Declarations

PHP has developed into a more strictly typed language in recent years. Type Declarations help with that and are a fairly new addition to PHP,


If you have come to JavaScript from a background in Java or C, then you will like the variation on the for loop. It is

Context Object Manipulation

One of the key concepts of JavaScript is the keyword this, which signifies the JavaScript context object. If you write an inner function, you can access

Polymorphic Functions

It is possible to define multiple functions with the same name in JavaScript, and the last one of those that you define will be the