I have a web page that lists a number of companies from a MYSQL database, the listing just shows the name of the company. When user clicks on the company name a jquery accordion slider shows the rest of the information about that company.When company name is clicked it also sends a request to a php script to log that a person has viewed that company's details. My Problem I want to send the ID for each record to the php script.I have achieved this by including the accordion jquery code within the while loop that reads the output of the mysql query, but it generates a lot of unnecessary source code (i.e. for each company listed).I need to include the jquery accordion code outside of the while statement. How do I pass the id of each database record (i.e. company name) to the $.post in the jquery code, when it is outside of the while loop?Accordion Jquery code\[code\]$(document).ready(function() { $('div.listing> div').hide(); $('div.listing> h4').click(function() { $.post("/record.php", { id: "<?php echo $LM_row02[id]; ?>" } ) var $nextDiv = $(this).next(); var $visibleSiblings = $nextDiv.siblings('div:visible'); if ($visibleSiblings.length ) { $visibleSiblings.slideUp('fast', function() { $nextDiv.slideToggle('fast'); }); } else { $nextDiv.slideToggle('fast'); } }); });\[/code\]Any idea most welcome.