J
J
justdani2018-03-14 11:58:59
Database
justdani, 2018-03-14 11:58:59

How to store tables in a database?

There is an html table, 5 columns 30 lines, how can I save it in the database in order to be able to change each field of the table and access it? Now I store in json, but this option is not suitable. You need to constantly make changes to individual fields. How can I save a table in the database so that it remains a table?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander null, 2018-03-14
@snikes

create a table with 5 columns, and insert 30 records (cell values)))
Next, select everything from the table and loop output

I
Igor Vorotnev, 2018-03-14
@HeadOnFire

The easiest option:

|  id  |  json_data  |
|------|-------------|
|   1  |  ...        |

You can always get a specific table by id, you can store the data of one specific table in json. To edit this data, you will still take the entire table for output, so overwriting the entire json is quite ok.
If the use case is more complex, provide more details. Then the answers will be more accurate.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question