I have some varible that are arrays with different types of car models and I need to read it either with a for
or something similar for then those data obtained insert them into a database in their respectable brands
the arrays are the following ..
/////////////// este array ira enla tabla toyota ///////////////////
var toyotaCars= [
{
text: "4runner",
value:"4runner",
disabled:true,
selected: false
},
{
text: "camry",
value:"camry",
selected: false
},
{
text: "corolla",
value:"corolla",
selected: false
}
];
/////////////// este array ira enla tabla honda ///////////////////
var hondaCars= [
{
text: "accord",
value:"accord",
disabled:true,
selected: false
},
{
text: "civic",
value:"civic",
selected: false
},
{
text: "crv",
value:"crv",
selected: false
}
];
/////////////// este array ira enla tabla nissan ///////////////////
var nissanCars= [
{
text: "murano",
value:"murano",
disabled:true,
selected: false
},
{
text: "skylan",
value:"skylan",
selected: false
},
{
text: "350-Z",
value:"350-Z",
selected: false
}
];
the table to insert the extracted data I want it to be like this
--------|--------------|--------------|--------------|
id | honda | toyota | nissan |
--------|--------------|--------------|--------------|
1 | accord | 4runner | murano |
--------|--------------|--------------|--------------|
2 | civic | camry | skylan |
--------|--------------|--------------|--------------|
3 | crv | corolla | 350-z |
--------|--------------|--------------|--------------|
As you will see the arrays are called by their respective example brands the array toyotaCars their values would be inserted in the field toyota , the hondaCars in the field honda etc ... could someone give me an idea of how I can do this function that inserts the models of vehicles in their respective fields?
What happens is that I was using a library for selected inputs and I would require these arrays to do the options
and then imagine changing the library and the one I'm using now uses the normal html tags that is the structure selects
and options
and I want the vehicle models that I had in those arrays are now in the database, I'm just doing the example with 3 car models and 3 car brands but the actual code has more 50 vehicle brands and more than 1000 car models so doing this one by one in the database would not be very funny but I already have them in the arrays of the example I would only insert them in the database.
I hope you can help me