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

[eluser]stuffradio[/eluser]
http://ellislab.com/codeigniter/user-gui...ation.html

DB_Debug if set to true will display db errors.
#22

[eluser]Salvatore Formisano[/eluser]
Just a quick reply to say that I haven't solved this yet, but as soon as I'll have time to be back on it I'll write here (it seemed to me like somebody else had a similar issue?)

- Salvatore
#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




Theme © iAndrew 2016 - Forum software by © MyBB