SELECT COUNT from multiple tables

Hello Everybody, i new here and really need some help,

i have this code which it shows me all the users i have but i created a new module to only show me users from a specific role (ei: admin, supervisor, etc) tthe roles are in another table in my mysql how can i show only user from specific role:

tableName1 is my users and tableName2 is my roles

// SETUP PAGING VARIABLE
// ------------------------------------------------------------
$tableName1=“users”;
$tableName2=“users_in_roles”;
$targetpage = “resellers.php”;
$limit = GV_PAGE_SIZE;
$stages = 2;

// ------------------------------------------------------------
// GET DISPLAY QUERY STRING VALUE
// ------------------------------------------------------------
if(isset($_GET[‘display’]) && !empty($_GET[‘display’]) && is_numeric($_GET[‘display’]) && $_GET[‘display’] >= 0 && $_GET[‘display’] <= 1000)
{
$display = strip_tags($_GET[‘display’]);
$_SESSION[‘display’] = $display;
$limit = $_SESSION[‘display’];
$remember_limit = $limit;
}
else
{
$display = $limit;
}

/


$S = mysql_query("SELECT * FROM Users, Roles WHERE Users.ID = Roles.UserID AND Roles.Type = '$Role'") or die(mysql_error());

Not tested but it should work. http://dev.mysql.com/doc/refman/5.0/en/left-join-optimization.html

THANKS The fixed didn’t work but the reference page helped me a lot this is what i got

$query_string = “SELECT COUNT(*) AS TotalCount FROM $tableName2 WHERE RoleID = RoleID#”;

	$query_string = "SELECT COUNT(*) AS TotalCount FROM $tableName1";