Rows or an Array

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
psurrena
Forum Contributor
Posts: 355
Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY

Rows or an Array

Post 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.
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: Rows or an Array

Post by omniuni »

How do you plan on storing the data exactly? To a file? To a database?
User avatar
psurrena
Forum Contributor
Posts: 355
Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY

Re: Rows or an Array

Post by psurrena »

database
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: Rows or an Array

Post by omniuni »

How many items are there, and what kind of data?
User avatar
psurrena
Forum Contributor
Posts: 355
Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY

Re: Rows or an Array

Post by psurrena »

five items, text. Probably limit the text to 100 characters an item.
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: Rows or an Array

Post 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.
Post Reply