Yes, you can save a list in MySQL by creating a table with a column that stores the list. You can save the list as a comma-separated string or in JSON format. Here's an example of creating a table with a column that stores a list as a comma-separated string:

CREATE TABLE my_list ( id INT AUTO_INCREMENT PRIMARY KEY, list VARCHAR(255) );

You can then insert a list into the table as follows:

INSERT INTO my_list (list) VALUES ('item1, item2, item3');

To retrieve the list, you can use the SELECT statement:

SELECT list FROM my_list WHERE id = 1;

This will return the list 'item1, item2, item3'. You can then split the string into a list in your application code.

can we save list in mysql

原文地址: https://www.cveoy.top/t/topic/1o3 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录