Welcome Guest, Not a member yet? Register   Sign In
Looping $_POST values into a CRUD Model
#1

[eluser]opel[/eluser]
I have used PHP to handcode my own CMS but have been playing bout with CI. I am aware there are plenty of CRUD libraries out there but I am trying to create my own controllers/models to add/edit/delete data so that I can understand my app and CI before.

I have tried to update my old class methods for insert and update into CI but I am not having much luck. What I am trying to do is take all the values of $_POST, unset the button value and then generate an array that I can use in AR to insert/update my db

the code that I am trying below is loosing the "$this" part when I try to print_r as a test.

Code:
function process_add() {
      unset($_POST['Submit']);

     foreach($_POST as $key=>$value){
        
        $data[$key] = $this->post->('$value');
     }

}


Could anyone give me any suggestions or point me in the way of a tutorial that may help?


Messages In This Thread
Looping $_POST values into a CRUD Model - by El Forum - 09-23-2008, 05:16 PM
Looping $_POST values into a CRUD Model - by El Forum - 09-24-2008, 09:16 AM
Looping $_POST values into a CRUD Model - by El Forum - 09-24-2008, 10:16 AM
Looping $_POST values into a CRUD Model - by El Forum - 09-24-2008, 03:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB