Answer the question
In order to leave comments, you need to log in
How to add data separated by commas in db?
How to add a value to db separated by commas, for example, there is a table in the database, and the number 123456 in the table, how to add another number 946428, so that it is like this: 123456, 946428?
So that there are separate numbers, as in the list.
Answer the question
In order to leave comments, you need to log in
Easily:
UPDATE tbl SET val = IF(val IS NULL, :new_val, CONCAT(val, ',', :new_val))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question