title: Generic fast coded PHP MySQL dynamic insert/update query creating table/fields named as variables if doesnt exists
body: <p>I'm looking for a way to make MySQL insert/update queries more dynamic and fast to code since sometimes one just need another field in a form (when for example <strong>prototyping</strong> an application). This might be a dumb question.  </p>
  
  <p>My idea is to make an insert or update if ids match, and if table/fields doesn't exists create it with one function dynamically. </p>
  
  <pre><code>&lt;?php 
  // $l is set with some db-login stuff
  
  // creates and inserts
  $f[] = nf(1,'this_id_x'); // this_id_* could be a prefix for ids
  $f[] = nf('value yep',$fieldname_is_this2)
  $tbl_name = "it_didnt_exist";
  nyakilian_fiq($l, $tbl_name, $f);
  // Done!
  
  
  //This would do an update on above
  $fieldname_is_this2 = "this is now updated";
  $f[] = nf(1,'this_id_x'); 
  $f[] = nf($fieldname_is_this2); // the function takes the variable name as field name
  $tbl_name = "it_didnt_exist";
  nyakilian_fiq($l, $tbl_name, $f);
  
  ?&gt;
  </code></pre>