Page 1 of 1

Rows or an Array

Posted: Tue Jul 22, 2008 3:44 pm
by psurrena
I am going to store a list created from a form with a field for each item.

Would it be better to make rows (item 1, item 2....) or store the input from the fields as an array?

Thanks.

Re: Rows or an Array

Posted: Tue Jul 22, 2008 4:17 pm
by omniuni
How do you plan on storing the data exactly? To a file? To a database?

Re: Rows or an Array

Posted: Tue Jul 22, 2008 4:21 pm
by psurrena
database

Re: Rows or an Array

Posted: Tue Jul 22, 2008 4:37 pm
by omniuni
How many items are there, and what kind of data?

Re: Rows or an Array

Posted: Tue Jul 22, 2008 5:19 pm
by psurrena
five items, text. Probably limit the text to 100 characters an item.

Re: Rows or an Array

Posted: Tue Jul 22, 2008 5:46 pm
by omniuni
As long as you are sure that it will never be more than the 5 items, I see no reason why you can't use an array. That said, if you ever need to do ANYTHING other than display the items, like sort them, search them, etc. Use a table in the DB.