当我从MySQL表中选择所有数据时,我想以PHP的降序获取记录。我该怎么做?请帮忙。
答案 0 :(得分:1)
SELECT * FROM table ORDER BY column_name DESC;
答案 1 :(得分:1)
如果要从数据库中选择数据ORDER ID降序。请遵循以下代码:
SELECT * FROM Table ORDER BY id DESC
例如:
<?php
$sql=mysqli_query($con,"SELECT * FROM Table ORDER BY id DESC");
while($row=mysqli_fetch_array($sql)){
print_r($row);
}
?>