when i am added any query code is added in blocks our taxonomy term is not working they give two kind of errors:
- PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'term' in 'where clause' when i clicking on taxonomy term
Notice: Trying to get property of non-object in eval() when i am added code in blocks Here is my code:
$nid=arg(1); $tid=db_query("SELECT th.tid FROM taxonomy_term_hierarchy th INNER JOIN taxonomy_term_data td ON th.tid=td.tid INNER JOIN field_data_field_books book ON book.field_books_tid = th.tid WHERE td.vid = '6' AND th.parent = '0' AND book.entity_id = $nid ")->FetchField(); print $tid->Name; $child=taxonomy_get_children($tid); foreach($child as $t) { $link = l($t->name, 'taxonomy/term/' . $t->tid)."<br>"; print $link; }