Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

code acting crazy


nana

Recommended Posts

hello i am having a very strange problem here.

$tot_trade=tep_db_query("select sum(vac_three) as tot_trade from orders where date_format(date_purchased,'%m/%d/%Y') >= '{$_POST['start_date']}' and date_format(date_purchased,'%m/%d/%Y') <= '{$_POST['end_date']}'");
 $row_trade=tep_db_fetch_array($tot_trade);
$tot_mon=tep_db_query("select sum(account_number) as tot_mon from orders where date_format(date_purchased,'%m/%d/%Y') >= '{$_POST['start_date']}' and date_format(date_purchased,'%m/%d/%Y') <= '{$_POST['end_date']}'");
 $row_mon=tep_db_fetch_array($tot_mon);

and futhur down i have

<tr>
                 <td width="34%" align="right" class="dataTableContent"><b>Total labor</b></td>
                 <td width="1%"> </td>
                 <td width="65%" class="dataTableContent"><?php echo $row_mon['tot_mon'];?></td>
               </tr>
                <tr>
                 <td width="34%" align="right" class="dataTableContent"><b>Total trade in value</b></td>
                 <td width="1%"> </td>
                 <td width="65%" class="dataTableContent"><?php echo $row_trade['tot_trade'];?></td>
               </tr>

i get the correct or at least close to correct value when i am searching in some of the fields but not the others here vac_three gives me a value that is close but account_number gives me a number but it is not even close

i need to get the total sum of those fields within the dates both are decimal in the db

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...