2010-02-06 67 views

回答

1

此查詢將爲您獲取術語ids。

db_query("SELECT DISTINCT tid FROM {term_node}"); 
0

下面的代碼應該完全符合你的要求。

$terms = array(); 
$result = db_query("SELECT * FROM {term_data} WHERE tid IN (SELECT DISTINCT(tid) FROM {term_node})"); 
while($term = db_fetch_object($result)) { 
    $terms[] = $term; 
}