Hi,
I want to add interest based on daily basis to my account tables. This is my account tables.
shakthi(ID, account_type,full_name, balance, interest). There are another 3 tables which includes same fields.
The amount is credited and the balance is updated very well. But interest should be added daily. I think it is a good way add interest manually by running a query.
A manager should execute that query each day.The query i tried is,
<?php
$connect=mysql_connect("localhost","root","");
mysql_select_db("bank",$connect) or die ("could not select database");
function update_interest(){
$query="UPDATE savings_investment SET `balance`= (`balance`+`balance`*`interest`12/3000)";
mysql_query($query) or die(mysql_error());
$query="UPDATE shakthi SET `balance`= (`balance`+`balance`*`interest`7/3000)";
mysql_query($query) or die(mysql_error());
$query="UPDATE surathal SET `balance`= (`balance`+`balance`*`interest`14/3000)";
mysql_query($query) or die(mysql_error());
$query="UPDATE abhimani_plus SET `balance`= (`balance`+`balance`*`interest`1/300)";
mysql_query($query) or die(mysql_error());
}
?>
But i want to know how i connect to this into my tables??
Thanks,
Heshan