I'm trying to do the following:
$sql_tid = db_query('SELECT tid FROM taxonomy_index WHERE nid = :nid', array(':nid' => $node->nid));
But it doesn't seem to get the nid right because I get the following notice:
Notice: Undefined variable: node in include_once() (line 3 of mymodule/mymodule.module).
Notice: Trying to get property of non-object in include_once() (line 3 of mymodule/mymodule.module).
What am I doing wrong? And is this the right approach?
I'm new to Drupal and don't fully understand how to use its framework.