こんにちは、全員、 私は日付でテーブルを並べ替えたいですが、並べ替えることができませんでした。 あなたたちが私を助けてくれることを願っています。日付表並べ替えPHPページ--- MySql
ここに私のコードは、あなたがコードを貼り付けするのを忘れて、私は、これはあなたが欲しかったものであると思います
<table class="table table-striped table-bordered bootstrap-datatable datatable responsive">
<thead>
<tr>
<th>Name</th>
<th>Action</th>
<th>Date and Time</th>
</tr>
</thead>
<tbody>
<?php
$result= mysql_query("select * from history order by history_id DESC ") or die (mysql_error());
while ($row= mysql_fetch_array ($result)){
$id=$row['history_id'];
?>
<tr>
<td><?php echo $row['data']; ?></td>
<td><span class="label-primary label label-default"><?php echo $row['action']; ?></span></td>
<td><span class="label-success label label-default"><?php echo date("M d, Y H:i:s",strtotime($row['date'])); ?></span></td>
</tr>
<?php } ?>
</tbody>
</table>
ようこそスタックオーバーフロー。 * Claps * –
'select * history_idの履歴順DESC、date DESC'知っていますか? mysql_ *はPHP 7で閉じられています – devpro
あなたは日付または履歴IDに応じて最新のものから古いものをお探しですか? – devpro