[eluser]tim peterson[/eluser]
hi all,
I'm having a heck of a time figuring out how to post multiple ratings for different items,
this code let's me rate multiple items, but not single items:
<b> for($i=0;$i<2; $i++)
{
$doc_item_id=$_POST['item_id0'][$i];
$doc_rating=$_POST['document_rating'][$i] ;
$it_rt = array(
'item_id'=> $doc_item_id,
'rating' => $doc_rating,
);
$this->purchases_model->update_document($it_rt);
}
</b>
whereas this code let's me rate only the first item:
<b> foreach($_POST['item_id0'] as $doc_item_id)
{
foreach($_POST['document_rating'] as $doc_rating)
{
}
break;
}
$it_rt = array(
'item_id'=> $doc_item_id,
'rating' => $doc_rating,
);
$this->purchases_model->update_document($it_rt);
</b>
any thoughts on how to correct either of these would be greatly appreciated,
thank you,
tim