Sorry for the esoteric subject line, but I couldn't think of anything better. I'm using PHP to search a MySQL database, and I want to limit the number of matches displayed to 20 per page. But I also want to know the total number of matches. This kind of thing is seen all over the place, and I know how to do it with two separate SQL queries to the database. But is there a way to do it with a single query? Or should I not worry about this as a performance issue?

For example (and I'm being very loose here):

First Query: "SELECT Count(*) FROM Table_Name"
$total_matches=mysql_num_rows;

Second Query: "SELECT * FROM Table_Name LIMIT 20"
etc...

Is this bad? Should I be trying to do this with just one MySQL query? Thanks!