Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- questions answers
- +-----+---------+ +------+------+---------+
- | id_q| question| | id_q | id_a | answer |
- +=====+=========+ +======+======+=========+
- | 1 |question1| | 1 | 1 | answer1 |
- +-----+---------+ +------+------+---------+
- | 2 |question2| | 1 | 2 | answer2 |
- +-----+---------+ +------+------+---------+
- | 1 | 3 | answer3 |
- +------+------+---------+
- | 1 | 4 | answer4 |
- +------+------+---------+
- | 2 | 5 | answer5 |
- +------+------+---------+
- | 2 | 6 | answer6 |
- +------+------+---------+
- | 2 | 7 | answer7 |
- +------+------+---------+
- | 2 | 8 | answer8 |
- +------+------+---------+
- this->db->SELECT('*');
- this->db->FROM('answers');
- this->db->WHERE('answers.id_q', $x); // $x -> variable that has the id o the selected question
- this->db->UPDATE('answers', $data);
- answers
- +------+------+---------+
- | id_q | id_a | answer |
- +======+======+=========+
- | 1 | 1 | answer1 |
- +------+------+---------+
- | 1 | 2 | answer1 |
- +------+------+---------+
- | 1 | 3 | answer1 |
- +------+------+---------+
- | 1 | 4 | answer1 |
- +------+------+---------+
Add Comment
Please, Sign In to add comment