hi, i'm not sure if it is possible but maybe someone can answer... i have a mysql db and in a table i have about 10.000 entries all with multiple variables... now i wonder if there is a way i could set a certain value for one of the variables i can go and edit each entry but i hope there is an "automated" way to do that... thanks in advance ps: if you don't understand what i mean, please ask for more details - i can give examples
do you mean fields instead of variables? You want to change one or more of the fields in a database to a different value? If so, you can use the sql command UPDATE.
ok, i am a 0 at sql ... how would the command look if: table name: prefix_A camp name: name_B with values: C, D, E, F now let's say all values are set to C, how can i set them all to D ? i use phpmyadmin (if it metters)
Do you have a column in your table where there are values that range from C to F, and you want them all the be D?... Please explain in detail a little better please.
indeed, i have a column with 4 variables, the default one is A (for example) and i want them all to be B (for example)... but not to change the default one...
Is this what you mean, you have a table, there is a column in there where the values could be A, B, C, D, E, F. Example: Row 1 - B Row 2 - A Row 3 - C Row 4 - F Row 5 - D Row 6 - A Row 7 - C You want everything that is not A to be changed to B (for example)? Your last sentence is very confusing.
sorry, i know nothing about sql that's why i can't explain it as you'd wish ... i'll give it one more try so: there is a table called prefix_A with more fields and one of the fields contains entries which can take 4 values (A, B, C and D) and the default one is A so i want to change them all to B but i aslo want to keep the default value A for the next entries (which will be added from now on...) if it still doesn't make sens, please give an example of update command so maybe i can try it
UPDATE prefix_A set name_B="B"; Code (markup): will set everything in the column name_B to B. This will of course only affect the records already in the database. This will not affect future inserts. You can set a default of "A" in the table structure and from then on, if no value is entered, the database will automatically set it to "A".
hehe it worked i just needed to change the "B" to 'B'.. maybe because of the phpmyadmin version or something.. it didn't work with "" thanks a lot !