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

[eluser]Salvatore Formisano[/eluser]
Hey everyone, I just wanted to write down the code that is now doing the trick for me:

Code:
function reorder_photos()
    {
        foreach($_POST as $key=>$value){
            $data['position']=$value;
            $this->m__crud->update_record("photos",$key,$data);
        }
    }

the rest of the code was unaltered from my previous posts. I haven't put my hands on it since my last time on this forum, I played with it for less than 10 minutes and it now works.

Sometimes one really needs to get away from something and head to the next task, so he can then come back and realize how easy it was to get the thing done!

Thanks everyone for the support,
Salvatore


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



Theme © iAndrew 2016 - Forum software by © MyBB