answersLogoWhite

0

How use update command in mysql?

Updated: 11/9/2022
User Avatar

Wiki User

12y ago

Best Answer

A simple example of how to use it would be something like this:

UPDATE addresses SET street = 'north' WHERE lastname = 'smith';

There are far far more things that you can do with it than that of course, and I would recommend reading the MySQL documentation for further details.

If you wish to use it in PHP, it can be done with a line like this one:

mysql_query("UPDATE addresses SET street='north' WHERE lastname='smith'");

which will execute the command on the currently selected database.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How use update command in mysql?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Where can information be found on how to do an MySQL update?

The MySQL UPDATE statement is one of the most commonly used commands in MySQL. The use is simple, but can be quite time consuming. Luckily there are professional tools like dbForge Studio for MySQL, that make all tasks faster and easier.


How do you use the replace command?

'replace' is not a standard Unix command. There is a replace command in mySql, but I don't know if this is the one you are referring to.


How do you update data in a MySQL database using PHP?

To update data from your MySQL database you need to use the mysql_query() function. Please see the example below: <?php mysql_query("UPDATE table_name SET field_name_2 = '77' WHERE field_name = 44"); ?>


What is MySQL insert command?

The INSERT command in MySQL allows you to enter a new row of data to a table in your database.


What is the role of the insert command in MySQL?

The INSERT statement in MySQL is used to add data to a table. The INSERT INTO command inserts one or more rows into a MySQL table. For single row insertion you need to use the following syntax: INSERT Into table_name(column_1,column_2,column_3) VALUES(value_1, value_2, value_3); To speed up the process, you can use additional MySQL database management tools. For example, in dbForge Studio for MySQL, you can use the Generate Script as feature to insert one or more rows into a MySQL table.


What is MySQL Databases?

MySQL is a database management system designed to manage relational databases. It is an open source software operated by Oracle. MySQL gives you the ability to modify its source code to suit your needs. To implement data-related tasks in MySQL databases you could use some database GUI, for example dbForge Studio for MySQL.


What is query in mysql?

Query is any command given to My Sql


How do you create a new database in MySQL?

The MySQL command is "CREATE DATABASE [dbname]" with "[dbname]" replaced with your desired database name.


How can you rename Database name in MySQL?

In MySQL, there is a special command for it: RENAME DATABASE x TO y However, if you are using MySQL version older than 5.1, you can't use this command. This command is only available for MySQL versions >= 5.1 See how to do it at the Related Links bellow!


What command is used to remove a table in MySQL?

Please refer to the related links section which points to the correct page of the on-line MYSQL manual.


How do you find the MySQL version?

There are several ways to check your current version: From the command line Using Workbench Via MySQL Client, exp. using dbForge Studio for MySQL


How do you REPLACE in MySQL?

update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');