[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!