There would be 3 components to this process- 1. User-facing page with <div id=data></div> 2. AJAX Javascript 3. Dynamic PHP page The user-facing page will contain an empty div marked by an ID. The AJAX script will be something like- http://whatsaranjit.com/includes/grabData.js[^] Lastly, the PHP page will contain a script like-
$sql = "SELECT * FROM table";
if (isset($_GET['q'])) {
$q = $_GET['q'];
$sql .= " ORDER BY $q ASC";
}
On your user-facing page, you can make your table header a hyperlink-
<a href='javascript: grabData('headerName', 'data', page.php)'>Sort</a>
When you click the link, it will refresh the SQL query data into the div named 'data' appending the SQL query to order by whatever variable you pass to the AJAX script. You can expand on this to to get it to ascend/descend. Good luck! Ranjit Viswakumar Professional Services Specialist rviswakumar@hostmysite.com http://hostmysite.com/?utm_source=bb[^]