Table Union with COUNT/PDO

I have several websites with multiple sections (e.g. Topics, World). For each section, I start the ball rolling with a simple COUNT(URL) query to display pages, like this…


$sql= "SELECT COUNT(URL) AS num FROM people WHERE URL = :url";
$stmt = $pdo->prepare($sql);
$stmt->bindParam(':url',$MyURL,PDO::PARAM_STR);
$stmt->execute();
$Total = $stmt->fetch();

switch($Total['num'])
{
 case 1:
 break;
 case 2:
 break;
 default:
 break;
}

Now I’m working on another website that will essentially represent a merger of all these other projects. So I need a query that does the same thing for multiple tables, such as people, pox_topics and gz_life. I tried UNION ALL, but it doesn’t work. Another problem is that the target field isn’t called URL in all tables. For example, the corresponding field in the table gz_life is “Taxon.” I thought I could fix that with an alias (e.g. Taxon AS URL), but that isn’t working, either.

Can anyone suggest a way to union tables for a simple COUNT query in PDO mode?

Thanks.