How to Update a Column in MySQL

Save

MySQL is the most widely used open source database for web applications. Content management systems such as Drupal and Wordpress often require MySQL in their installations. It is also the database preferred by PHP developers and is commonly bundled with PHP and Apache web server in installation packages. MySQL comes with a command-line application called MySQL Monitor which allows you to execute SQL statements to insert, update and delete rows within your database. For those using MySQL bundled with PHP and Apache, a web application called phpMyAdmin also provides a MySQL control panel with a graphical user interface.

Update Columns Using MySQL Monitor

  • Open MySQL monitor and log in with your username and password.

  • Select the database you wish to update. For example, to use the database named TARDIS, type in the following at the command prompt:

    use TARDIS;

  • Type in the SQL statement to update your column. To update the Date column of a table named "Destination" where the Location is equal to "Gallifrey" you can use the following SQL statement:

    UPDATE Destination

    SET Date='2011-11-11'

    WHERE Location='Gallifrey';

    If updating more than one column, for example "Date" and "Time," you can use the following statement:

    UPDATE Destination

    SET Date='2011-11-11', Time='11:11:11'

    WHERE Location='Gallifrey';

  • Press Enter to submit the changes.

Update Columns Using phpMyAdmin

  • Open phpMyAdmin and log in.

  • Click the name of the database you wish to update columns for.

  • Find the table you'd like to change, and click on the "Browse" icon next to it.

  • Put a check mark on all the records that need to be updated and click on the pencil icon or the "Change" icon.

  • Edit the text on all the columns you wish to update and click on "Go."

References

  • Photo Credit Jupiterimages/Photos.com/Getty Images
Promoted By Zergnet

Comments

Resources

You May Also Like

  • How to Change the Column Name in MYSQL

    Sometimes a MySQL database designer does not know the appropriate column name for data until after he has designed and implemented a...

  • How to Update Multiple Columns

    Structured Query Language (SQL) is used to select, retrieve, add and delete data within a database (a collection of related tables). You...

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

M
Is DIY in your DNA? Become part of our maker community.
Submit Your Work!