i have two table in mysql 1st is fees and 2nd is expenses
i want fees table subtract in to expenses table
how can i do this please help me to fix this issue thanks
fees table
------------------------------
id | name | grn | fees|
------------------------------
expence table
------------------------------
id | invoice | amount
------------------------------
this table showing only sum of 1st fees table
// connect to the database
include('connect-db.php');
$sql = "select sum(fees) from fees";
$q = mysql_query($sql);
$row = mysql_fetch_array($q);
echo 'Sum: ' . $row[0];
This is showing like this 23445 only 1st table result
and i want like this
23445 fees table result
- 3234 expense table result
------
20211 total income
------