thats very easy to do hofan. The way justin would set it up would be
Code:
CREATE TABLE cart (
cart_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
PRIMARY KEY (cart_id)
);
and for your dynamic data, where you could have an unlimited amount of fields you would put it in another table like this one
Code:
CREATE TABLE cart_data (
cart_data_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
cart_id INT UNSIGNED,
cart_data_value varchar(100),
PRIMARY KEY(cart_data_id)
);
so as your array gets bigger you can keep adding more and more values into the cart_data table, when you want to get all the rows of the array back from the database you would query with a left join statement like this
Code:
SELECT * FROM cart LEFT JOIN cart_data USING(cart_id) WHERE cart_id = ?
Then you can loop through and restore your array.
The first table would be for static data or data related to the current user, while the second table is only there to fulfill the unknown number of values in your array. If all you are storing is an array, then you can forgo the first table and just use the second one.