Here's the place where it's hanging up on show.php....
// do the query
$query="SELECT * FROM $type WHERE common_name='" . $name . "'";
echo $name . "<br>";
Everything before the query works, so we have solid usable values for $name and $type, so it should work in the query.
But, everything after the query doesn't work. It selects nothing, thinking there are no instances where $name and common_name are the same.