All pastes #811266 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-12-10 19:27 UTC
rendered paste body
function answer_list_by_questionary( $q_qid){
  $result='';

  $result= _answer_list_by_questionary( $q_qid);

  $items= array();
  if( $result){
    while ($question = db_fetch_object( $result )) {
      // theme each item
      $items[] = theme( 'answer_list_item', $question);
    }
  }
  return theme( 'item_list', $items, 'answers for ' . $nid);
}

function _answer_list_by_questionary( $q_qid){
  $result= db_query('SELECT n.nid, n.title FROM {questionary_answer} a INNER JOIN {node} n ON n.nid=a.nid WHERE a.q_qid= %d', $q_qid);
  return $result;
}