Drupal 6 querying multiple tables
I think you need a proper inner join.

Tweaking your snippet to:

$currentTIDs = db_query("SELECT tn.tid, td.name 
                         FROM {term_node} tn 
                         INNER JOIN {term_data} td
                         ON tn.tid = td.tid 
                         WHERE tn.nid = 22640");

while ($cTids = db_fetch_object ($currentTIDs)) {
   array_push($currentTIDsArray, $cTids);
}

drupal_set_message('&lt;pre&gt;' . print_r($currentTIDsArray, TRUE) . '&lt;/pre&gt;');


I digress, but worth mentioning Drupal coding conventions on variable names etc.. can be found here: http://drupal.org/coding-standards#naming