在该字段上加标识符,如字段为id,name
用表格形式打印该字段为echo "<tr><td><a href=?order=id>id</a></td><td>a href=?order=name>name</a></tr>";
接着就是判断了,用switch 
                {
                  cass id:$sql.=" where id asc";
                  cass name:$sql.=" where name asc";
                 }
就行了,虽然我也是个菜鸟,我们可以互相学习的