Jump to content

Inserting data into the same field - mysql approach?


CookieMonster94

Recommended Posts

I have a set of records which display details about various people. One column is additional information/facts. I would like people to be able to add as many facts as they like via a form and this be stored in the database. I do not want to overwrite what is currently there. I'm currently looking for ideas as to how to approach this task i.e. how to store this information. Should this be stored as a array, in a separate table etc. Any help would be greatly appreciated.

Well, the first technical constraint would be the data type of the current "additional information/facts" column. How much data will it hold?

 

Because you can CONCAT things in SQL:

 

//let's add data about this person and delimit each statement with a semicolon ...
update people_details_table set additional_info = concat(additional_info,'; ',$yet_another_fact) where id = $some_number;
EDIT: speaking of "additional info", you seem to have posted the same question twice. Is it possible to undo that?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.