我的主计长
$data[ qna ] = $this->Ivote_模式->get_qa();
意见
foreach($qna as $k=>$v){
echo $v[ question ]. <br/> ;
echo - .$v[ answer ] . <br/> ;
模式
function get_qa(){
$data = array();
$this->db->select( * );
$this->db->where( v_questions.id ,1);
$this->db->from( v_answers );
$this->db->join( v_questions , v_questions.id = v_answers.question_id );
$q = $this->db->get();
if($q->num_rows > 0){
foreach($q->result_array() as $row){
$data[] = $row;
}
}
$q->free_result();
return $data;
}
页: 1
What is your favorite food?
-Sushi
What is your favorite food?
-Burgers
What is your favorite food?
-kodo
......
What is your favorite food?
-Sushi
-Burgers
-koddo
请帮助我如何做到这一点?