Passing a PHP variable from a div tag to jquery when clicked
<p>I have a requirement to get a variable from PHP to Javascript when clicked by the user. I have an array of data returned by a query and I need to pass an ID value for the element clicked so that I can populate an additional data set via the .load using another PHP page. I am unsure how todo this?</p>

Javascript Code in Page:

<pre><code>&lt;script type="text/javascript"&gt; 
$(function () { 
 $("#pass_userid_div").click(function () {

    $("#another_div").load('remote_pages/get_info.php?userid=' + $GET_THE_USERID_AND_PASS_HERE);
  });
});
&lt;/script&gt; 
</code></pre>

PHP Code in Page:

<pre><code>$query_str = "SELECT id, username, dateregistered FROM users";
$query = mysql_query($query_string) or die(mysql_error());

while ($results = mysql_fetch_array($query)) {
    print "&lt;div id='pass_userid_div'&gt;{$results['username']}&lt;/div&gt;";
    print "&lt;div&gt;{$results['dateregistered']}&lt;/div&gt;";
}
</code></pre>
