开发者

SQL - PHPmyadmin - Alter table order by 'id ascending' - Make permanent

If I run this:

ALTER TABLE  `equipos11a12` ORDER BY  `ID`

It only happens one time. If I change the ids, it wont change in ascending order.

I have to run the alter table everytime in order开发者_如何学Go for the ids to order.

Here is my php code:

 $query = "SELECT  * FROM equipos11a12";

$result = mysql_query($query);  ?>

while($person = mysql_fetch_array($result)) {

echo " " . $person ["name"] . " "; 


You must add the order by clause to your select query :

$query = "SELECT  * FROM equipos11a12 ORDER BY `ID` ASC"; // ascending order    
$query = "SELECT  * FROM equipos11a12 ORDER BY `ID` DESC"; // descending order
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜