根据数据库中的输入名称或id获取数据

I have a view result page where after log in and adding details a user can view his or her profile info. But the problem is that View result shows all the database entries include the user..where I dont wish it to be. I wish the only entry of ther active user. Is the following code is sufficient? or I give the whole code

$result=mysql_query("SELECT * FROM users ORDER BY name DESC");

I would suggest you to learn more about the Mystery of SQL.

$result = mysql_query(
    "SELECT * FROM users WHERE activeuser='Swati' ORDER BY name DESC"
);

You need a WHERE statement such as WHERE UserID=$_SESSION['UserID']