Welcome Guest, Not a member yet? Register   Sign In
New in codeigniter! poll problem
#6

[eluser]larsjeh[/eluser]
[quote author="benfike" date="1251076276"]Error Number: 1066

Not unique table/alias: 'votes_answers'

SELECT * FROM (`votes_answers`, `votes_answers`) JOIN `votes` ON `votes`.`id` = `votes_answers`.`pid`

update: when I delete that: $this->db->from('votes_answers'); the page work, but again list all answers, not only where vote_id = other vote_id[/quote]

Sry m8 made a mistake with $this->db->get Wink, i think this should work.
Code:
function getAnswers(){
        $data = array();
    $this->db->select('*');
    $this->db->from('vote_answers')
    $this->db->join('vote_question', 'vote_question.vote_id = vote_answers.vote_id');
    $Q = $this->db->get();
        if ($Q-> num_rows() > 0){
            foreach ($Q-> result_array() as $row){
            $data['answer'] = $row['answer'];
        }
        }
        $Q-> free_result();
        return $data;
        //DEBUGGING MKKAAYY :)
        print_r($data);
    }


Messages In This Thread
New in codeigniter! poll problem - by El Forum - 08-23-2009, 08:48 AM
New in codeigniter! poll problem - by El Forum - 08-23-2009, 09:57 AM
New in codeigniter! poll problem - by El Forum - 08-23-2009, 12:34 PM
New in codeigniter! poll problem - by El Forum - 08-23-2009, 12:45 PM
New in codeigniter! poll problem - by El Forum - 08-23-2009, 02:11 PM
New in codeigniter! poll problem - by El Forum - 08-24-2009, 12:02 AM
New in codeigniter! poll problem - by El Forum - 08-24-2009, 04:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB