Page 1 of 1

Adding numerous fields to a table and displaying in a form

Posted: Sun Apr 04, 2010 10:40 am
by PMacca_1987
Hi guys,

I'm having issues working out whether what I wish to do with my code is possible and how I would start to go about coding it.

The story is as follows..!

The intended use for the system is for a user (salesperson) to log in and add sales to their record.

To do this the user will be required to go into a settings section to select the attributes that they wish to store about their products. So rather than me telling the user what fields to store such as price and size, the user will select the names of these themselves and also the number of fields that they will use. :banghead:

Then I wish to display them in a form that the user can use to add details about their products.

I intend to create this using php and mysql but if any javascript is required then I guess I will have to use it.

Apologies if this seems vague but please let me know if you have any questions/solutions.

Paul

Re: Adding numerous fields to a table and displaying in a fo

Posted: Sun Apr 04, 2010 12:48 pm
by Christopher
Store each attribute individually in a separate table. Each record will have the user's ID, the product ID, the attribute, and the associated data.

Re: Adding numerous fields to a table and displaying in a fo

Posted: Sun Apr 04, 2010 12:53 pm
by PMacca_1987
Thanks very much for your reply, ill get to work on it now.
:D

Re: Adding numerous fields to a table and displaying in a fo

Posted: Sun Apr 04, 2010 2:36 pm
by califdon
At the risk of misunderstanding what you are trying to do, I would suggest that you should give a lot of thought to whether you want to do this at all. Unless you intend to write an entire generalized database application (a monumental task), you will have a very crippled system, since you won't provide the users a decent user interface, query capabilities, reports, etc. If you just want to test your own programming skills, OK, but if this is a serious project, I would recommend that you explore some online database systems, some of which are free, up to some volume limit. One such site is http://infodome.com/.

Re: Adding numerous fields to a table and displaying in a fo

Posted: Mon Apr 05, 2010 8:48 am
by PMacca_1987
OK, what would be the difference between using an online database in comparison to a mysql database if the application will be doing the same thing?

The idea of the system is to allow a customer to personalise their products before they add the data. I understand that this will likely cause reporting issues, will using an online database solve this?

Thanks

Re: Adding numerous fields to a table and displaying in a fo

Posted: Mon Apr 05, 2010 1:03 pm
by califdon
Yes, that's the point. If you have looked at the site I referenced, or of others of similar nature, you should see that they provide the entire user interface, allowing users to design their own tables, their own forms, their own reports. You are not required to do ANY programming. I found that particular site to have a very advanced and intuitive user interface for designing and using a database (which is probably MySQL behind the scenes, anyway). Another feature is that you can designate other users to share a database with, so you could, for example, have a group of sales personnel (or agents, or whatever) who could have various permissions (to view reports, to enter data, to modify or add tables, forms, reports, etc.).

In other words, with a staff of programmers and years of work, they have already developed the system that you are asking how to develop.