yes, using dirty hacks. I'd prefer doing "lock tables <table> read; select count(*) ... ; select * ... limit 20; unlock tables;" and read the two result sets.
However -
Approach 1 : Union - row count as a row.
Overload the meaning of a column to contain both the count and the data :
select count(*) from table union select field1 from table limit 20;
Perhaps you want more than one column, then you need fake columns for the first select :
select count(*) as row1, 0 as row2 from table union select field1, field2 from table limit 20;
Approach 2 : subquery/join - row count as a column.
select (select count(*) from table) as count, field1 from table limit 20;