I am working on a project in PHP & MySQL, I have a Table with an expandable amount of fields. I have been looking for a way to work out an array system to handle this but am unsure. I am not looking for someone to code it for me but would like opinions on the best way to handle it.
Exp:
TABLE Stage one:
ID OPTION1 OPTION2
1 dirt drop
2 ground lake
3 clay pond
Now to explain what I am looking to do: I need to create a way to allow my arrays to see all the fields and make an array for each once so.
Exp:
$arrayone(dirt,ground,clay);
$arraytwo(drop,lake,pond);
But if I add a new field to my Database like so:
Exp:
TABLE Stage one:
ID OPTION1 OPTION2 OPTION3
1 dirt drop sky
2 ground lake cloud
3 clay pond sun
I need it to see the new field and allow for another array to be created on proccess..
Exp:
$arrayone(dirt,ground,clay);
$arraytwo(drop,lake,pond);
$arraythree(sky,cloud,sun);
Like I said I have been looking but not sure what I need to be looking for if anyone know and if it can be done could you point me to some references I can read up on to create.
I have this EXP:
$stringfromdb = "1,2,3,4";
$stringfromdb = "5,6,7,8";
Now i want to my php to take these two strings and build Arrays like
$arrayone(1,5);
$arraytwo(2,6);
$arraythree(3,7);
$arrayfour(4,8);
But if i was to add more to the string later like
$stringfromdb = "1,2,3,4,9,10";
$stringfromdb = "5,6,7,8,11,12";
I would need it to creat new arrays based off the new added sections of the string..
$arrayone(1,5);
$arraytwo(2,6);
$arraythree(3,7);
$arrayfour(4,8);
$arrayfive(9,11);
$arraysix(10,12);
I do plan on using some form of explode(); to split the scripts at the separators. Not sure if this helps at all.. to get my issue across lol sorry...
cross reference tablefor this. One table containing the options (option_id, title) , one table containing the values (value_id, title) and one table for combining them (option_id, value_id)