Gossamer Forum
Home : General : Internet Technologies :

How to calculate the result of fee?

Quote Reply
How to calculate the result of fee?
I use PHP and MySQL create the program to retrieve data from the table of grants in webpage:

The table with the data of all grants, I want to calculate the result of the used grant by subtracting the amount of expanses each time used. for example:


Balance

50000

400

6000

300

------------------

result $43300

Please help me get the way to retrieve the result each time submitted. Thank you!
Quote Reply
Re: [xiaofei] How to calculate the result of fee? In reply to
How are we meant to do that? You don't even give us any sample code for how you are grabbing the figures, and what/where they are being held Wink

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [xiaofei] How to calculate the result of fee? In reply to
Hi Andy!

Thank you for your reply! I attached my code here, please help me check it. I want to get the result by subtracting the amount each time I submited into the table.

Thank you for your greatest help!!!

xiaofei kemp
Quote Reply
Re: [xiaofei] How to calculate the result of fee? In reply to
Hi Andy!

I have been waiting for your reply on how to calculate the result of fee. Here is my code, Is it OK for me type in the retrive(output) page? It still can't work. Which step I did wrong? Does cursor support MySQL?

<? PHP

$Host = "192.165.1.1";

$User = "xxxx";

$password = "xxxx";

$DBName = "XXXX";

$TableName = "XXXX";

$Link = mysql_connect($Host, $User, $Password);

$Query = "Select amount from $TableName";

MySQL_select_db($DBName, $Link);

$Result = MySQL_db_query($DBName, $Query, $Link);

Class PaymentAccount

{

var $balance = 50000.00;

function CheckingAccount($amount)

{ $this->balance = $amount;}

function clear_check($amount)

{$this->balance=$this->balance-$amount;}

function get_balance()
{
return $this->balance;
}

}

?>
Quote Reply
Re: [xiaofei] How to calculate the result of fee? In reply to
Hi Andy!

Please delete this Item with its attachment balance.php
Quote Reply
Re: [xiaofei] How to calculate the result of fee? In reply to
Aki or Wil would have to delete as being forum moderators. Andy is not a moderator of this forum. If you want it deleted, contact Aki or Wil.
========================================
Buh Bye!

Cheers,
Me