循环时将特定记录显示为最后一个值

The table records are

tag       enabled

paypal      1
bank        1
creditcard  1
COD         1

and my query is

$sql = "SELECT * FROM payment_type WHERE enabled = '1'";
    $result = mysql_query($sql);
    while($data = mysql_fetch_assoc($result)) {
    echo $data['tag'];
}  

Here I want to show creditcard as last value for some reasons. Thanks in advance.

try this: see DEMO

$sql = "SELECT * FROM payment_type WHERE enabled = '1'
        Order By case when tag <> 'creditcard' then 0 else 1 end;"

Use a case to make an individual sort order

SELECT * FROM payment_type 
WHERE enabled = '1'
order by case when tag = 'creditcard' 
              then 1
              else 2
         end