mysql showing two select statements as one output
You can combine them like this:

select 
    count(CASE WHEN sub like '%bar%' or comment like '%bar%' THEN postid ELSE NULL END) AS count_bar, 
    count(CASE WHEN sub like '%foo%' or comment like '%foo%' THEN postid ELSE NULL END) AS count_foo
from 
    myTable 
where 
    (sub like '%bar%' or comment like '%bar%'
     or sub like '%foo%' or comment like '%foo%') 
    and replies IS NOT NULL
group 
    by time div 3600 
order by 
    time div 3600 asc;


Note that I also change and replies IS NOT NULL, assuming you have rows that are actually NULL. With the quotes you used, you treated it as a string, but NULL is really nothing. You can't compare it like other datatypes, you have to use the special IS NULL or IS NOT NULL comparison.