title: XEditable using PHP MySQL Update via Ajax: issue with updating different columns.
body: <p>I have multiple database columns but have stuck with two for now just to get two working (category and product). </p>
  
  <p>As of now, I can update the category column, but I'm not sure how to implement my php so it will account for multiple columns.</p>
  
  <p>Note. I can ONLY edit one database field at a time, and that is my intention. </p>
  
  <p>Here is a simplified version of my HTML/php in question:</p>
  
  <pre><code>    echo '&lt;td&gt;&lt;span class="xedit" id="'.$propRow['id'].'"&gt;'.$propRow['category'].'&lt;/span&gt;&lt;/td&gt;';
      echo '&lt;td&gt;&lt;span class="xedit xedit-product" id="'.$propRow['id'].'"&gt;'.$propRow['product'].'&lt;/span&gt;&lt;/td&gt;';
      echo "&lt;/tr&gt;";
      $rows []= array(
          'id' =&gt; $propRow['id']
      );
  </code></pre>
  
  <p>Here is my JS:</p>
  
  <pre><code>        var rowData = &lt;?php echo json_encode($rows); ?&gt;;
          for (i = 0; i &lt; rowData.length; i++){
              var rd = rowData[i].id;
  
              jQuery(document).ready(function() {
                  $('.xedit').editable({
                      tpl: '&lt;input type="text" name="category" id="' + rd + '" class="test form-control input-sm" style="padding-right: 24px;"&gt;'
                  });
                  $(document).on('click','.editable-submit',function(){
                      var num = $(this).closest('td').children('span').attr('id');
                      $.fn.editable.defaults.mode = 'inline';
                      $.fn.editable.defaults.send = "always";
                      var values = $(".test").val();
                      var myObj = { id: num, category: values };
                      $.ajax({
                          url: 'post.php',
                          type: 'post',
                          data: myObj,
                          success: {}
                      }); 
                  });
              });
  
          }
  </code></pre>
  
  <p>My post.php file is here (And I think this is where the issue lies. Please refrain from commenting on the usage of mysql_* functions):</p>
  
  <pre><code>&lt;?php
      include '../config/database.php';
      $category = $_POST['category'];
      $product = $_POST['category'];
      $id = $_POST['id'];
      $query = "UPDATE " . $usoc_table . " SET category='" . $category . "', product='" . $product . "' WHERE id='" . $id . "';";
      mysql_query($query);
  ?&gt;
  </code></pre>
  
  <p>What type of conditionals do I need to set up in post.php to get this working? I've toyed around with isset and !empty but have not had much luck. </p>
  
  <p>Any advice is appreciated. Thank you. </p>