I have these values in the array=Array ( [0] => 3 [1] => 2 [2] => 10 [3] => 5 )
How do i get each value separately from the array and perform the below calculation?
$j=$q*100/$ytot;
And this is what i've tried so far, which isnt giving the correct value :
$resul=mysql_query("select * from post_bet where bet_id = '$id'")or die(mysql_error());
if(mysql_num_rows($resul)>0)
{
while($row=mysql_fetch_assoc($resul))
{
$y_uid=$row['yes_userid'];
$y_uamt=$row['yes_useramount'];
$n_uid=$row['no_userid'];
$n_uamt=$row['no_useramount'];
$ytot=$row['yes_total'];
$ntot=$row['no_total'];
$hhh=explode(',',$row['yes_useramount']);
$q = print_r($hhh);
echo $j=$q*100/$ytot;
}
}
$j,$q, and$ytot?