If you want the whole tuple containing the largest value of the "thread" attribute, then you have at least two choices:
select *
from tablename
order by thread desc
limit 1
Often it's sufficient just to get the maximum value, and your query should be fine:
select max(thread)
from tablename
There could be several reasons why you get an empty result. It's probably due to an error in your PHP code, but it's hard to say when we cannot see your code.