Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.355 diff -u -p -r1.355 taxonomy.module --- modules/taxonomy/taxonomy.module 14 May 2007 13:43:37 -0000 1.355 +++ modules/taxonomy/taxonomy.module 14 May 2007 20:59:41 -0000 @@ -1132,6 +1132,22 @@ function taxonomy_get_term_by_name($name } /** + * Returns the term ID for the given term name. + * + * NOTE: If more than one match is found, this function will return the first + * one it finds. If you have duplicate term names in your database, you may + * wish to use the more robust taxonomy_get_term_by_name() instead. + * + * @param $name + * Name of the term to search for. + * @return + * The term ID of the given term, or FALSE if none was found. + */ +function taxonomy_get_tid_by_name($name) { + return db_result(db_query(db_rewrite_sql("SELECT t.tid FROM {term_data} t WHERE LOWER('%s') LIKE LOWER(t.name)", 't', 'tid'), trim($name))); +} + +/** * Return the vocabulary object matching a vocabulary ID. * * @param $vid