我试图按第3列(日期列)对我的数据表进行排序但是它似乎只按日期列中的第一个数字排序,如下图所示我如何才能得到它以便按日期排序比数字?
echo "<table>
<thead>
<th>Zone</th>
<th>Popularity</th>
<th>Date</th>
</thead>";
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['location'] . "</td>";
echo "<td>" . $row['count(location)'] . "</td>";
echo "<td>" . $row['date'] . "</td>";
echo "</tr>";}
echo "</table>";
mysqli_close($con);
?>
<script>
$('table').DataTable( {
dom: 'Bfrtip',
"order": [[ 2, "desc" ]],
buttons: [
'copy',
{
extend: 'csv',
text: 'CSV',
extension: '.csv',
exportOptions: {
modifier: {
page: 'current'
}
},
title: 'table'
},
'pdf',
'print', ],
} );
</script>