Fixed types.php

queries correctly, has message if nothing matches.

Thanks Leo!