How do I get the taxonomy term ID from its name? The only function on the list of taxonomy.module functions that looks like it does what I want appears to be a private function (_taxonomy_get_tid_from_term). 

What function am I supposed to use if all I know is the taxonomy term name and I need to find out its ID?
taxonomy_get_term_by_name() will do the trick:

$terms = taxonomy_get_term_by_name($row-&gt;field_term_name);
if (!empty($terms)) {
  $first_term = array_shift($terms);
  print $first_term-&gt;tid;
}