I have created a mysql table name 'members' where payment and ewallet are two columns... I want to make ewallet
column such that it will automatically update when payment will update.. the rule will be ewallet=0.75*payment
. How it is possible?
there is another column 'enroller_id' through which i am calculation the left count and the right count downline with the php function
function getTotalLeg($node,$leg){
$sql="select enrolled_id from members where enroller_id='$node' and tside='$leg' and active='1'";
$res=mysql_query($sql);
global $total;
$total=$total+mysql_num_rows($res);
$row=mysql_fetch_array($res);
if($row['enrolled_id']!=''){
getTotalLeg ($row['enrolled_id'],0);
getTotalLeg ($row['enrolled_id'],1);
}
return $total;
}
Is it possible to count it in the database? Please help me in detail way. Thanks in advance.