Hi, i was just wondering if there was a way to edit all values in a row in a mysql database. any help appriciated. sorry if this question is simple, i must just not be noticing something.
heres an example.
Database
Table example1
ID, Name, Lastname, Number
1, John, Smith, 3
2, David, Spring, 1
etc
im wondering if theres a way to increase all numbers in the number column by 3 for example so itll be
Table example1
ID, Name, Lastname, Number
1, John, Smith, 6
2, David, Spring, 4
etc
thanks for any help.
[SOLVED] Editing all values in a row by a curtain number
Moderator: General Moderators
[SOLVED] Editing all values in a row by a curtain number
Last edited by mickd on Thu Jul 21, 2005 1:03 am, edited 1 time in total.
Sure there is, if you want to update an existing field in a dbase just use:
update <tablename> set <fieldname>=<fieldname>+3 <where clause if you want to use it>
As long as your base field has int, bigint, or tinyint it should work fine..
Btw there are no simple questions, right? We all started from scratch..
update <tablename> set <fieldname>=<fieldname>+3 <where clause if you want to use it>
As long as your base field has int, bigint, or tinyint it should work fine..
Btw there are no simple questions, right? We all started from scratch..