Store data using For Loop - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Store data using For Loop (/showthread.php?tid=39599) |
Store data using For Loop - El Forum - 03-15-2011 [eluser]omar_yoi[/eluser] Hi Guys, So here is my problem: below is my html. -first column, to set how many questions -2nd and 3rd, will be the question and the answer. -user will be able to set max 3 questions and answers. Code: <?php echo form_open('testing/test');?> Next, I would like to store this information on the database. I have 5 columns on the table test: num, pertanyaan, jawaban, status, id. the columns status, id will have the same values the only different will be num, pertanyaan and jawaban. Code: example now below is my model. Code: private $tbl = 'test'; FYI: num = number. pertanyaan = question. jawaban = answer. Can someone give me a clue where I did wrong? thanks in advance. Store data using For Loop - El Forum - 03-15-2011 [eluser]omar_yoi[/eluser] Ok, I got it working, just simply a typo error,. XD On this line. Code: $this->db->insert($this->$tbl,$qna); Changed to Code: $this->db->insert($this->tbl,$qna); Isn't that such a cute error? LMAO ! Thanks for reading though. |