Welcome Guest, Not a member yet? Register   Sign In
Getting array parameters from POST
#1

[eluser]derekt[/eluser]
I'm writing a page to reorder images using JQuery and Ajax to POST the image order back to my controller so I can update the database; I've got the page returning this via POST:

POST
item[] 17
item[] 1
item[] 9

However, the database isn't updating. I'd really appreciate some advice on what I'm missing here. The controller function looks like this:

Code:
function index ()
    {
        foreach($this->input->post('item',TRUE) as $key=>$value):
        {
                $this->db->where('id', $value)->update('photo_order_map', array ('sort_order'=>$key));
        }
    }

I tried setting $config['enable_query_strings'] = TRUE; to no avail.
Any suggestions??

Thanks!


Messages In This Thread
Getting array parameters from POST - by El Forum - 11-04-2009, 02:34 AM
Getting array parameters from POST - by El Forum - 11-04-2009, 02:52 AM
Getting array parameters from POST - by El Forum - 11-04-2009, 03:03 AM
Getting array parameters from POST - by El Forum - 11-04-2009, 04:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB