Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Storing data of varying type.
03-24-2009, 03:29 PM #1
- Join Date
- Mar 2009
- Thanked 0 Times in 0 Posts
Storing data of varying type.
I am creating a flexible web application in PHP and am a little confused as to how to structure my database. I am trying to store what I am calling "data models" (since I don't know the correct technical term!) in a database which will describe what something is made up of, as well as the data for that object.
Apple is made up of: - One Textfield - One Image - Two Booleans
Data Models - id - name Data Model Fields - id - model_id (relation to the data models table above) - field_name - type (which I'd enter something like text field / image / boolean)
Apple - Test - image1.jpg - true - true
Can anyone help suggest a way in which I can structure my database to allow for a similar model based work flow?
03-24-2009, 10:11 PM #2
So how many different data models do you expect to have??
The obvious answer, if you say "not too many", is to simply use CREATE TABLE to create a table exactly designed to hold an "Apple" object.
If you say "thousands" then the problem is thornier.