title: jquery/mysql insertion error
body: <p>As you may gather from the code below I am trying to get a profile updater script working. I seem to be running into problems though. I am getting the 'hello' alert when the script finishes processing but it seems as if the jquery is not properly grabbing the values from the textboxes because my mysql table is returning nothing inserted. any ideas? below is my code and screenshots:</p>
  
  <p><img src="https://i.stack.imgur.com/GwAvB.png" alt="enter image description here"></p>
  
  <p>Frontend Code:</p>
  
  <pre><code>&lt;?php include("vh.php"); ?&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function() {
      var birthdate = $("#birthdate").val();
      var sex = $("#sex :selected").val();
      var interestedIn = $("#interestedIn :selected").val();
      var relationshipStatus = $("#relationshipStatus :selected").val();
      var knownLanguages = $("#knownLanguages").val();
      var religiousViews = $("#religiousViews").val();
      var politicalViews = $("#politicalViews").val();
      var aboutMe = $("#aboutMe").val();
      var mobilePhone = $("#mobilePhone").val();
      var neighborhood = $("#neighborhood").val();
      var website = $("#website").val();
      var email = $("#email").val();
  
      $("#submitForm").live('click', function() {
          updateUserInfo();
      });
  
      function updateUserInfo() {
          jQuery.ajax({
              type: "POST",
              dataType: "JSON",
              url: "&lt;?=base_url()?&gt;index.php/regUserDash/updateUserInfo",
              data: { birthdate: birthdate,
                      sex: sex,
                      interestedIn: interestedIn,
                      relationshipStatus: relationshipStatus,
                      knownLanguages: knownLanguages,
                      religiousViews: religiousViews,
                      politicalViews: politicalViews,
                      aboutMe: aboutMe,
                      mobilePhone: mobilePhone,
                      neighborhood: neighborhood,
                      website: website,
                      email: email
              }, success: function(data) {
              if(data.userInfoUpdated == true) {
                  alert("hello");
              }
            }
         });
      }
      });
  &lt;/script&gt;
  &lt;?php $selectedId = $_REQUEST['id'];
        $myuserid = $this-&gt;session-&gt;userdata('userid'); ?&gt;
                          &lt;table style="width: 34%"&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px"&gt;&lt;span class="font1"&gt;Birthdate&lt;/span&gt;&lt;/td&gt;
                                      &lt;td style="width: 275px"&gt;
                                      &lt;input id="birthdate" class="textbox1" style="width: 200pt" type="text" /&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px"&gt;&lt;span class="font1"&gt;Sex&lt;/span&gt;&lt;/td&gt;
                                      &lt;td style="width: 275px"&gt;
                                      &lt;select class="textbox1" id="sex" style="width: 207pt"&gt;
                                      &lt;option selected="selected"&gt;Select your sex&lt;/option&gt;
                                      &lt;option&gt;Male&lt;/option&gt;
                                      &lt;option&gt;Female&lt;/option&gt;
                                      &lt;/select&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px" class="font1"&gt;Interested In&lt;/td&gt;
                                      &lt;td style="width: 275px"&gt;
                                      &lt;select class="textbox1" id="interestedIn" style="width: 207pt"&gt;
                                      &lt;option selected="selected"&gt;Select your interest&lt;/option&gt;
                                      &lt;option&gt;Men&lt;/option&gt;
                                      &lt;option&gt;Women&lt;/option&gt;
                                      &lt;/select&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px" class="font1"&gt;Relationship Status&lt;/td&gt;
                                      &lt;td style="width: 275px"&gt;
                                      &lt;select class="textbox1" id="relationshipStatus" style="width: 207pt"&gt;
                                      &lt;option selected="selected"&gt;Select your relationship status&lt;/option&gt;
                                      &lt;option&gt;Single&lt;/option&gt;
                                      &lt;option&gt;In a relationship&lt;/option&gt;
                                      &lt;option&gt;Engaged&lt;/option&gt;
                                      &lt;option&gt;Married&lt;/option&gt;
                                      &lt;option&gt;It's complicated&lt;/option&gt;
                                      &lt;option&gt;In an open relationship&lt;/option&gt;
                                      &lt;option&gt;Widowed&lt;/option&gt;
                                      &lt;option&gt;Seperated&lt;/option&gt;
                                      &lt;option&gt;Divorsed&lt;/option&gt;
                                      &lt;option&gt;In a civil union&lt;/option&gt;
                                      &lt;option&gt;In a domestic partnership&lt;/option&gt;
                                      &lt;/select&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px" class="font1"&gt;Known Languages&lt;/td&gt;
                                      &lt;td style="width: 275px"&gt;
                                      &lt;input class="textbox1" id="knownLanguages" style="width: 200pt" type="text" /&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px" class="font1"&gt;Religious Views&lt;/td&gt;
                                      &lt;td style="width: 275px"&gt;
                                      &lt;input class="textbox1" id="religiousViews" style="width: 200pt" type="text" /&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px" class="font1"&gt;Political Views&lt;/td&gt;
                                      &lt;td style="width: 275px"&gt;
                                      &lt;input class="textbox1" id="politicalViews" style="width: 200pt" type="text" /&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px" class="font1"&gt;About Me&lt;br /&gt;
                                      &lt;br /&gt;
                                      &lt;br /&gt;
                                      &lt;br /&gt;
                                      &lt;/td&gt;
                                      &lt;td style="width: 275px"&gt;
                                      &lt;textarea class="textarea2" id="aboutMe" style="width: 198pt; height: 93px"&gt;&lt;/textarea&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px" class="font1"&gt;Mobile Phone&lt;/td&gt;
                                      &lt;td style="width: 275px"&gt;
                                      &lt;input class="textbox1" id="mobilePhone" style="width: 200pt" type="text" /&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px" class="font1"&gt;Neighborhood&lt;/td&gt;
                                      &lt;td style="width: 275px"&gt;
                                      &lt;input class="textbox1" id="neighborhood" style="width: 200pt" type="text" /&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px" class="font1"&gt;Website&lt;/td&gt;
                                      &lt;td style="width: 275px"&gt;
                                      &lt;input class="textbox1" id="website" style="width: 200pt" type="text" /&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px" class="font1"&gt;Email&lt;/td&gt;
                                      &lt;td style="width: 275px"&gt;
                                      &lt;input class="textbox1" id="email" style="width: 200pt" type="text" /&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td style="width: 193px" class="font1"&gt;&amp;nbsp;&lt;/td&gt;
                                      &lt;td style="width: 275px; text-align: right"&gt;
                                      &lt;input id="submitForm" type="button" value="Submit" style="width: 63px; height: 28px" class="button1"&gt;&lt;/td&gt;
                                  &lt;/tr&gt;
                              &lt;/table&gt;
  </code></pre>
  
  <p>Backend Code:</p>
  
  <pre><code>public function updateUserInfo() {
          $userid = $this-&gt;session-&gt;userdata('userid');
          $birthdate = $this-&gt;input-&gt;post("birthdate");
          $sex = $this-&gt;input-&gt;post("sex");
          $interestedIn = $this-&gt;input-&gt;post("interestedIn");
          $relationshipStatus = $this-&gt;input-&gt;post("relationshipStatus");
          $languages = $this-&gt;input-&gt;post("languages");
          $religiousViews = $this-&gt;input-&gt;post("religiousViews");
          $politicalViews = $this-&gt;input-&gt;post("politicalViews");
          $aboutMe = $this-&gt;input-&gt;post("aboutMe");
          $mobilePhone = $this-&gt;input-&gt;post("mobilePhone");
          $neighborhood = $this-&gt;input-&gt;post("neighborhood");
          $websites = $this-&gt;input-&gt;post("websites");
          $email = $this-&gt;input-&gt;post("email");
  
          $this-&gt;db-&gt;query("INSERT INTO user_info (birthdate, sex, interestedIn, relationshipStatus, Languages, religiousViews, politicalViews, aboutMe, mobilePhone, neighborhood, websites, email, userid)
                            VALUES('{$birthdate}', '{$sex}', '{$interestedIn}', '{$relationshipStatus}', '{$languages}', '{$religiousViews}', '{$politicalViews}', '{$aboutMe}', '{$mobilePhone}', '{$neighborhood}', '{$websites}', '{$email}', '{$userid}')");
  
          echo json_encode(array('userInfoUpdated' =&gt; true));
      }
  </code></pre>