Dynamic Form Fields

Hi, I’m creating a receipt system for my work. Basically, our employees will logon to a computer to create a receipt, entering details such as the customers name, phone number, address, etc. I also need to enter the product details.

This is my problem. I want to display only one field for the product but have an option to add another field if the user needs it. But how can this be done as I need to enter these products into the database, so not sure how I can enter these extra fields…I don’t want to enter blank fields into the database.

Any ideas would be really appreciated :smiley:

You’ve stumbled upon something called row-modeling, which is opposed to column-modeling which is the foundation of relational databases.
Since it’s a pretty broad topic, you have several choices - either leave blank columns for those extra attributes and set them as null if they are not populated (you wouldn’t believe how many enterprise level applications use this approach), use a Key:Value NoSQL solution such as MongoDB / CouchDB (which do not have so many features that relational databases have) or develop your own entity-attribute-solution within the db system you use.