title: jQuery post a serialized form then inserting into mysql via php?
body: <p>I'm trying to post a serialized form to a sumbit.php file, in turn, will then insert into a MySQL database; however, the last input which is hidden, is not getting inserted into the database, though the rest are.</p>
  
  <p>Here's some snippet examples of what I've got thus far which is not working:  </p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>            &lt;form method="post" action="" &gt;
                              &lt;label for="name" class="overlay"&gt;&lt;span&gt;Name...&lt;/span&gt;&lt;/label&gt;
                              &lt;input class="input-text" type="text" name="name" id="name" /&gt;
  
                              &lt;label for="email" class="overlay"&gt;&lt;span&gt;Email...&lt;/span&gt;&lt;/label&gt;
                              &lt;input type="text" class="input-text" name="email" id="email"/&gt;
  
                              &lt;label for="website" class="overlay"&gt;&lt;span&gt;Website...&lt;/span&gt;&lt;/label&gt;
                              &lt;input type="text" class="input-text" name="website" id="website"/&gt;
  
  
                              &lt;label id="body-label" for="body" class="overlay"&gt;&lt;span&gt;Comment it up...&lt;/span&gt;&lt;/label&gt;
                              &lt;textarea class="input-text" name="body" id="body" cols="20" rows="5"&gt;&lt;/textarea&gt;
  
                              &lt;input type="hidden" name="parentid" id="parentid" value="0" /&gt;
                              &lt;input type="submit" value="Comment" name="submit" id="comment-submit" /&gt;
  
                  &lt;/span&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p><strong>Javascript</strong> </p>
  
  <pre><code>$('form.').submit(function(event) {  
  
      $.post('submit.php',$(this).serialize(),function(msg){
          // form inputs consist of 5 values total: name, email, website, text, and a hidden input that has the value of an integer
      }
  });
  </code></pre>
  
  <p><strong>PHP (submit.php)</strong></p>
  
  <pre><code>$arr = array();
  
      mysql_query("   INSERT INTO comments(name,email,website,body,parentid)
                  VALUES (
                      '".$arr['name']."',
                      '".$arr['email']."',
                      '".$arr['website']."',
                      '".$arr['body']."',
                      '".$arr['parentid']."'
                  )");
  </code></pre>