Welcome Guest, Not a member yet? Register   Sign In
post multiple different ratings
#1

[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


Messages In This Thread
post multiple different ratings - by El Forum - 04-11-2011, 07:44 AM
post multiple different ratings - by El Forum - 04-13-2011, 05:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB