I was wondering if it is possible to use an array to populate a database to help save time. By that I meant doing the following…
instead of doing a query for the following
insert into table (option1, option2) Values (value1,value2)
I could simply have an array as following
array(option1=>value1,option2=>value2)
then find a way to use that array to populate the query. This way I can have as many variables as I want and simply use the key for the array as the field name and the array content and the content for the database.
This will save a lot of time by simply having 1 class which I can use for all updates as well as inserts. I’m not a pro at PHP and I’m simply trying to learn and save time. Any help would be appreciated.