Link to home
Start Free TrialLog in
Avatar of Easyrider43
Easyrider43Flag for United States of America

asked on

choose between dates

How can I rewrite this function and choose a result that is  in between certain dates for qt1 earnings etc..

my code is below. Thanks Experts!!.


function test($catagory, $date)
{

echo '<table border=1>';

include ($_SERVER['DOCUMENT_ROOT'] . '/onlineoffice/config/config.php');

mysql_pconnect($host, $user, $pass) or die ('Unable To Connect To Database!');

mysql_select_db('finanical_schema') or die ('Unable To Select Database!');

$query = "SELECT id, name, account_id, SUM(IF( b_accounts.Banking.type ='Withdrawl', -amount, amount)) 
		FROM finanical_schema.shema_names, b_accounts.Banking
		WHERE finanical_schema.shema_names.type ='$catagory' AND account_id = id GROUP BY id";

$result = mysql_query($query) or die ('Error in Selection query: $query. ' . mysql_error());

	while ($display = mysql_fetch_array($result, MYSQL_NUM))
		{
		echo '<tr><td>' . $display[1] . '</td><td>' . $display[3] . '</td></tr>';

		}


mysql_close();



}

Open in new window

Avatar of lalitgada
lalitgada
Flag of India image

ASKER CERTIFIED SOLUTION
Avatar of Om Prakash
Om Prakash
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial