Php 根据选择的顺序重新排列列表

Php 根据选择的顺序重新排列列表,php,jquery,mysql,Php,Jquery,Mysql,我有一个默认列表,它以表格格式显示。现在在表格上方,我有一个排序选项。现在,在没有给出该排序选项的表单和按钮的情况下,如何根据下拉选择框中选择的order by选项更改记录。 我正试图通过使用jquery来实现这一点。但最终,一切都白费了。我的代码如下: <?php $other_account_sql = "SELECT `admin_id`,`username`,`admin_name`,`role`,`status`,`email`,`contact_no`,`location`,`

我有一个默认列表,它以表格格式显示。现在在表格上方,我有一个排序选项。现在,在没有给出该排序选项的表单和按钮的情况下,如何根据下拉选择框中选择的order by选项更改记录。 我正试图通过使用jquery来实现这一点。但最终,一切都白费了。我的代码如下:

<?php
$other_account_sql = "SELECT `admin_id`,`username`,`admin_name`,`role`,`status`,`email`,`contact_no`,`location`,`creation_date` FROM `admin_details` WHERE `username` <> '".$_SESSION['existingUser']."'"; //this is for getting default lists 
?>
朋友,给你

<?php
$other_account_sql = "SELECT `admin_id`,`username`,`admin_name`,`role`,`status`,`email`,`contact_no`,`location`,`creation_date` FROM `admin_details` WHERE `username` <> '".$_SESSION['existingUser']."'" ORDER BY ". $_POST['sort_selection'].: ASC;
?>

但我不应该点击提交按钮……那么$u POST['sort\u selection']将如何获得?
<?php
$other_account_sql = "SELECT `admin_id`,`username`,`admin_name`,`role`,`status`,`email`,`contact_no`,`location`,`creation_date` FROM `admin_details` WHERE `username` <> '".$_SESSION['existingUser']."'" ORDER BY ". $_POST['sort_selection'].: ASC;
?>