$nombre=$_GET['order']; $tipo=$_GET['tipo']; // hago la consulta ahora // bla bla bla... select * from usuarios order by ".$nombre." ".$tipo);