PMA_isJustBrowsing() function wasn't checking if a query was a subquery. If query is a subquery then it couldn't be "just Browsing" and the function should return false. Before changing this, when a query like "SELECT COUNT(*) FROM (SELECT 1) AS TB" runs, it made the "$justBrowsing" input parameter of the function PMA_countQueryResults() true and PMA detected it as "just browsing". That's why this line was added.