Get id of element and post in sql query?
<p>Hey, I am trying to get the id of an element and then post that id in a sql query like this:</p>

<p>jQuery gets id of checkbox:</p>

<pre><code>$(document).ready(function() {    
    $(":checkbox").change(function(){
        var id = $(this).attr('id');

        $.post("index.php", { id: this.id, checked: this.checked },
            function(data){
              alert("Data Loaded: " + id);
            }
        );
       //return false to insure the page doesn't refresh
    });    
});
</code></pre>

<p>Then I insert that into the php query, but it doesn't display anything on the page. What am I missing?</p>

<pre><code>    $query1 = "SELECT * FROM explore WHERE category IN ('".$_POST["id"]."') 
ORDER BY category LIMIT $start, $limit";
</code></pre>
