Storing data + array
Posted: Wed Oct 26, 2005 5:38 am
Hi
I will explain this the best I can, basically I am curious if its pluasable to store and call post data like so:
I have a form with fields like so
name, description, picture, gallery, filter
then there are another 4 text fields across by 8 down ie:
a a1 a2 a3 a4
b b1 b2 b3 b4 b5
c c1 c2 c3 c4 c5 c5
etc
etc
I was thinking about storing each row as one field in the database seperated by a symbol so I can explode the data when I need to call on it and echo it ie:
$sql = "INSERT INTO products (name, description, picture, gallery, data1, data2 etc..) VALUES
('$name', '$description', '0', '$gallery, '$a|$a1|$a2|$a3|$a4', '$b|$b1|$b2|$b3|$b4');
Im thinking that this would make for less work when inserting and calling on the data, or would I be better off inserting each text field posted into its own field within the table?
Thanks
I will explain this the best I can, basically I am curious if its pluasable to store and call post data like so:
I have a form with fields like so
name, description, picture, gallery, filter
then there are another 4 text fields across by 8 down ie:
a a1 a2 a3 a4
b b1 b2 b3 b4 b5
c c1 c2 c3 c4 c5 c5
etc
etc
I was thinking about storing each row as one field in the database seperated by a symbol so I can explode the data when I need to call on it and echo it ie:
$sql = "INSERT INTO products (name, description, picture, gallery, data1, data2 etc..) VALUES
('$name', '$description', '0', '$gallery, '$a|$a1|$a2|$a3|$a4', '$b|$b1|$b2|$b3|$b4');
Im thinking that this would make for less work when inserting and calling on the data, or would I be better off inserting each text field posted into its own field within the table?
Thanks