ORDER BY in WHERE clause I am filtering my data with:

$sel_query="Select * from details where account_id=".$_SESSION['admin_id'];


I want to display records in descending order by using query:

$sel_query="Select * from details where account_id=".$_SESSION['admin_id'] 
ORDER BY time DESC;


Both queries working separately. When I write two conditions, the query is not working.
What do I need to change here?
It looks like your PHP is invalid. Shouldn't the second line be more like?

$sel_query="Select * from details where account_id=".$_SESSION['admin_id']." ORDER BY time DESC";