0

If I have an array as follows:

call array_create('test', 5);
set @list = 'trying:something:out:for:first';
call array_from_list_complete(@list, 'testarray', ':');

How can I create a field in table using create table ... to store the array, for example:

CREATE TABLE test(
    id_ int(5),
    number INT(10),
    *array, 
    PRIMARY KEY (int),
    )

Also, how can I insert that array into the table:

INSERT INTO test (id_, number, array) VALUES('data1', 'data2', 'testarray');
4

1 回答 1

0

您需要序列化数组并存储在 DB(数组到 json)中。获取时您需要反序列化(json 到数组)

于 2013-07-03T12:01:35.930 回答