title: php radio button auto update db table
body: <p>I have two radio buttons</p>
  
  <pre><code>&lt;div align="center" class="radio_group"&gt;
      &lt;input type="radio" id="gallerymenustyle1" class="element radio" name="gallerymenustyle[]" value="1" /&gt; Gallery Link - In the navigation of my website, display one "gallery" link&lt;br /&gt;
      &lt;input type="radio" id="gallerymenustyle2" class="element radio" name="gallerymenustyle[]" value="2" /&gt; Category Links - In the navigation of my website, display a separate link to each category.
  &lt;/div&gt;
  </code></pre>
  
  <p>how to update one field from a row, once I clicked one of those radio buttons without hitting a submit button ? </p>
  
  <p>here's what i have so far</p>
  
  <pre><code>$(function(){
             $(':radio').click(function(){
               if($(this).is(':checked')) 
                {
                     var galleryMenuStyleVal = $(this).val();
                     $.ajax({
                    type: 'POST',
                    url: '&lt;?php echo BASE_URL; ?&gt;ajax/ajax_methods_gallery.php',
                          data: 'showGalleryMenuStyleFromEditPage=' + galleryMenuStyleVal
                      });
                }
             });
          }); 
  
  
  if($_POST['showGalleryMenuStyleFromEditPage'] !== null || $_POST['shoGalleryMenuStyleFromEditPage'] !== 0){
      $userObj = new User();
      if($_POST['showGalleryMenuStyleFromEditPage'] == 1){
          $query = "UPDATE users SET gallery_menu_style = 1";
          $userObj-&gt;updateUserGalleryMenuStyle($query);
      } else if ($_POST['showGalleryMenuStyleFromEditPage'] == 2){
          $query = "UPDATE users SET gallery_menu_style = 2";
          $userObj-&gt;updateUserGalleryMenuStyle($query);
      } 
  }
  </code></pre>
  
  <p>is my jquery correct including some portions of PHP ? ..because it's not working</p>