I have a php program, an unconventional research NLP program, and in my program it would be useful to take an array which contains all of the attributes of a specific table in the form of key (attribute names) value (attribute values). I'm using static classes and passing info around...
Does anybody know if it's possible, from such an array, in a few lines, to insert the tuple into a corresponding table?
The following doesn't exist, and I know I could make my own function which does this, but this is what I'd like:
Are there any built-in functions that do this or that would make it easier than to build my own function from scratch?
People usually do this going the other way of course, using mysql_query and mysql_fetch_array... I'm trying to do just the opposite. That is, not to go from $query to $result and to $row, but rather $row (a php array) to insertion into a MySQL table.
Thanks in advance,
P.S. - One of the problems in making such a function is distinguishing between strings and values requiring quotes, and other values...