Inserting multiple $_Post arrays into a database
<p>how can I add <code>$_POST['wmeet']</code> into the auto INSERT or should I do a separate UPDATE. I want all 6 <code>$_POST['wmeet']</code> values to go into m_wmeet in format "ce1 sf1 sm1" a single space in between each value</p>

<pre><code>if (is_array($_POST['add']))
          foreach ($_POST['add'] as $key =&gt; $value) 
          $_POST['add'][$key] = mysql_real_escape_string(stripslashes($value));

if (is_array($_POST['wmeet']))
          foreach ($_POST['wmeet'] as $key =&gt; $value) 
          $_POST['wmeet'][$key] = mysql_real_escape_string(stripslashes($value));

        function dbSet($fields, $source = array()) {
            $set='';
            if (!source) $source = &amp;$_POST;
            foreach ($fields as $field) {
                if (isset($source[$field])) {
             $set.="`$field`='".mysql_real_escape_string($source[$field])."', ";
                }
            }
            return substr($set, 0, -2);
        }

$fields = explode(" ", "m_user m_pass m_email m_date m_ip m_type m_country m_place");
$query_mem = "INSERT INTO social_members SET ".dbSet($fields, $_POST['add']);

            mysql_query($query_mem);
</code></pre>
