I myself made a nice dynamic query based on metadata from PHPLIB (Modified it, because i only wanted 2 have the column names).

So i basically created a function --> make_sql($tabel,$data[array]) en took with my modified metadata the names out of that tabel.

Metadata uses --> mysql_list_fields and mysql_num_fields and then loop until i have the query build.

With that i created:
[PHP]
INSERT INTO ($name_column_1, $name_column_2,$name_column_3) VALUES ($$$name_column_1, $$name_column_2, $$name_column_3)
[PHP]

I can insert a SQL column at any time, without my script goin nuts on... invalid SQL statement.

What my question is:

Is there another way 2 do this or is this just a nice way of doin this? (Resources, Processor time based on a heavy loaded server).

So i am seeking some advice on strategy of using my function all over my website, when inserting nem records. (Know this, that i dont have any knowledge of what takes up resources in a server on PHP scripts).