#64951 by deepstar, Ambiguous query in taxonomy_get_term_by_name()

5.x
Neil Drumm 2006-05-24 04:54:52 +00:00
parent d7f3ace214
commit d80a410bb0
2 changed files with 2 additions and 2 deletions

View File

@ -997,7 +997,7 @@ function _taxonomy_term_children($tid) {
* An array of matching term objects.
*/
function taxonomy_get_term_by_name($name) {
$db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE LOWER('%s') LIKE LOWER(name)", 't', 'tid'), trim($name));
$db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE LOWER('%s') LIKE LOWER(t.name)", 't', 'tid'), trim($name));
$result = array();
while ($term = db_fetch_object($db_result)) {
$result[] = $term;

View File

@ -997,7 +997,7 @@ function _taxonomy_term_children($tid) {
* An array of matching term objects.
*/
function taxonomy_get_term_by_name($name) {
$db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE LOWER('%s') LIKE LOWER(name)", 't', 'tid'), trim($name));
$db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE LOWER('%s') LIKE LOWER(t.name)", 't', 'tid'), trim($name));
$result = array();
while ($term = db_fetch_object($db_result)) {
$result[] = $term;