It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

As you're using the older mysql_ methods, you can use mysql_num_rows() after you've executed the query:

$result = mysql_query($query);
$count = mysql_num_rows($result);

Side Note (mysql_ methods are being deprecated)
I would suggest refactoring your code to use the recommended mysqli_ or PDO methods instead. You can perform the same types of queries in both, but updating will grant you the ability to object-oriented style code, prepared statements which can help improve readability, and also further secure your code against SQL-injection.