Welcome Guest, Not a member yet? Register   Sign In
Issue with database record updating: updating record inside a foreach loop?
#5

[eluser]LuckyFella73[/eluser]
To call a method within a loop shouldn't be a problem.

Maybe you have to check the loop for errors. Here is an
example from an other thread:

Code:
foreach($_POST as $key => $value) {
  $value = $this->input->post($key);
}
Maybe your code should look like this:
Code:
foreach($_POST as $key => $value) {
          $position = $this->input->post('position');
          $this->m__crud->update_record("photos",'position',$position);
     }
I'm not very good with arrays (btw. looking at my code it does not to be
the cleanest solution ...) and didn't test this, but I think the problem lies
in this lines ...


Messages In This Thread
Issue with database record updating: updating record inside a foreach loop? - by El Forum - 12-16-2009, 05:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB