i have this query on drupal 6
$catq=' ( SELECT term_node.nid as node_id FROM {term_node} WHERE tid='.$catint.') as cat, '
i have upgrade it like this
$query=db_select('term_node');
->addfield('term_node', 'nid', 'node');
->field('term_node', 'node' );
->condition('term_node.tid', = , $catint);
$cat=$query->addfield($query, 'cat');
is it wrong?
You are doing it wrong. The right syntax for query - keeping your data will be:
But in drupal 7 there is no table term_node, probably you need 'taxonomy_index'.