saving & getting the values onto the page from the database
===

i have a php code like the following

php code:

    <div class="ma_form_line" ><label style="width:32%;text-align: left;margin-bottom:10px;">Marital Status: </label>
            <div class="ma_item"> <?=$Marital_status?></div><div class="ma_edit">
          <span class="select" id="selectm_status" >select</span> 
            <select style="width:250px;position:absolute;height:25px;" name="m_status"  id="m_status" class="styled aad">
            <option value="Select">Select</option>
            <option value="Single">Single</option>
            <option  value="Married">Married</option>
            <option  value="Divorced">Divorced</option>
            <option  value="Widowed">Widowed</option>      
            </select></div>
            </div>
             <div class="clr"></div>
             
            <div class="ma_form_line"><label style="width:32%;text-align: left;margin-bottom:10px;">Ethnicity:</label>
            <div class="ma_item"><?=$Ethnicity?></div><div class="ma_edit">
            <span class="select" id="selectethinicity"  >select</span> 
            <select style="width:250px;position:absolute;height:25px;" id="ethinicity"  name="ethinicity" class="styled aad">
            <option   value="Select">Select</option>
            <option  value="Caucasian">Caucasian</option>
            <option  value="Black">Black</option>
            <option  value="Hispanic">Hispanic</option>
            <option  value="Other">Other</option>
            </select></div>
            </div>
            <div class="clr"></div>
            
            
            <div class="ma_form_line"><label style="width:32%;text-align: left;margin-bottom:10px;">Primary Language:</label>
            <div class="ma_item"><?=$Primary_language?></div><div class="ma_edit">
            <span class="select" id="selectlanguage">select</span> 
            <select style="width:250px;position:absolute;height:25px;" id="language" name="language" class="styled aad">
            <option  value="">Select</option>
            <option  value="English">English</option>
            <option  value="Spanish">Spanish</option>
            <option  value="French">French</option>
            <option  value="Chinese">Chinese</option>
            <option  value="Indian">Indian</option>
            <option  value="Japanese">Japanese</option>
            <option  value="Other">Other</option>
            </select></div>
            </div>
            <div class="clr"></div>
            
            <div class="ma_form_line"><label style="width:32%;text-align: left;margin-bottom:10px;">Highest degree of education:</label>
            <div class="ma_item"><?=$Education_level?></div><div class="ma_edit">
            <span class="select" id="selecteducation">select</span> 
            <select style="width:250px;position:absolute;height:25px;" id="education"  name="education" class="styled aad">
            <option value="">Select</option><option value="Elementary/Middle School">Elementary/Middle School</option>
            <option value=" high school/GED"> high school/GED</option>
            <option value="technical trade school">technical trade school</option>
            <option value="college">college</option>
            <option value="post-collegiate">post-collegiate</option>
            </select>
            </div>
            </div>
            <div class="clr"></div> 
                             
                             
                                 
           <div class="ma_form_line"><label style="width:32%;text-align: left;">My Hobbies:</label>
            <div class="ma_item"><?=$hobby?></div><div class="ma_edit">
            <input type="text" name="hobby" id="hobby" value="<?=$hobby?>" style="width: 240px;display: block;border: none;height: 10px;padding-left:5px;" placeholder="Please enter a hobby" class="snappy aad" />
            </div></div>
            <div class="clr"></div> 

and these are the variables i used for saving the data from the above fields:

    $hobby=$user_data["hobby"];
    $Marital_status = $user_data["Marital_status"];
    $Ethnicity=$user_data["Ethnicity"];
    $Primary_language=$user_data["Primary_language"];
    $Education_level=$user_data["Education_level"];

my javascript code is:


    $('.saveaboutme').click(function () {
    $('.saveaboutme').css('display', 'none');
    $('.editaboutme').css('display', 'block');
    var barr = new Array;
    for (var i = 1; i < 5; i++) {
    barr[i - 1] = $('.aboutme .ma_form_line:eq(' + i + ') .ma_edit .aad').val();
    $('.aboutme .ma_form_line:eq(' + i + ') .ma_edit').css('display', 'none');
    $('.aboutme .ma_form_line:eq(' + i + ') .ma_item').css('display', 'block');
    		                       
    alert($('.aboutme .ma_form_line:eq('+i+') .ma_edit .aad').val());
    }
    
     //console.log(barr);
     if (barr[1] == "") {
      barr[1] = 0;
       }
       $.ajax({
       type: 'POST',
       url: root_url + '/services/services.php?method=updatabout',
       data: "m_status=" + barr[0] + "&ethinicity=" + barr[1] + "&language=" + barr[2] + &education=" + barr[3] + "&hobby=" + barr[4] ,
         async: true,
         success: function (data) {
         alert(data);
         if (data == 1) {
          window.location.assign("../index.php");
            //alert('user found');
                }
                  }
             });
    
           });

and this is my function i used to call the query to update the values in the database:

    function updatabout($detailsarr)
        {
            
            $query       = "UPDATE User_details SET Marital_status='" . $detailsarr['m_status'] . "', Ethnicity='" . $detailsarr['ethinicity'] . "', Primary_language='" . $detailsarr['language'] . "', Education_level='" . $detailsarr['education'] . "',Hobbies='" . $detailsarr['hobby']."'
              WHERE User_id=".$_SESSION['uid'];
            $queryresult = mysql_query($query);
            echo mysql_error().'<br />'.$query;
    
    }

here all the data are saving into my database except the "hobby" field and the value of the hobby field is showing as "undefined" in my database, as well as after clicking the save button, i'm getting the alerts & query what i used here but the values are displaying on the page only after refreshing the page...can anyone please letme know what the fault i've in this code...thanks in advance..