![]() |
Crazzy query idea - 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: Crazzy query idea (/showthread.php?tid=60873) |
Crazzy query idea - El Forum - 07-16-2014 [eluser]Atrhick[/eluser] Hello guys, I'm not a very good programmer so this maybe very simple but I'm going to ask anyhow. here is what I need to do I'm collecting this data from the view using post. Code: function add_test() { My problem is the when the user is creating a test they can create 350 questions in one test "yes the database can hold all that data in one table row" is there a loop i can create or something that will do what i have above based on how much data in coming in? I don't this its good coding practice for me to do the above code 350 time... or do I have to? Crazzy query idea - El Forum - 07-16-2014 [eluser]Rolly1971[/eluser] you could try something like this: Code: $postdata = $this->input->post(); Crazzy query idea - El Forum - 07-16-2014 [eluser]Atrhick[/eluser] [quote author="Rolly1971" date="1405537411"]you could try something like this: Code: $postdata = $this->input->post(); wow thank you that worked perfectly!!!! I only had to unset some post but it works like a charm!! i can't believe how easy and small this code was compared to what i was thinking of doing.. its a good thing i asked. Crazzy query idea - El Forum - 07-16-2014 [eluser]CroNiX[/eluser] He doesn't need to manually use escape anyway since he's using active record. Now things are going through escape twice. Crazzy query idea - El Forum - 07-16-2014 [eluser]CroNiX[/eluser] All of this: Code: $postdata = $this->input->post(); does the exact same thing as: Code: $this->db->insert('tests', $this->input->post()); |