Posted by Juliette on 12/29/05 07:21
svein.tjonndal@gmail.com wrote:
> I have the following query:
>
> select DATE_FORMAT(accountingdate,"%c") as month,sum(totalprice -
> freightcost - insurancecost - vat2 - vat3 - vat4) as totalprice from
> invoice where cancelled=0 and deliveryagentid=0 and (employeeid=0 or
> employeeid=37 or employeeid=53 or employeeid=50) and
> DATE_FORMAT(accountingdate,"%Y")="2005" group by month order by month;
>
> Giving the following result in MySQL (correctly):
> +--------+--------------+
> | month | totalprice |
> +--------+--------------+
> | 1 | 540274351.00 |
> | 10 | 119601657.00 |
> | 11 | 118712994.00 |
> | 12 | 109391926.00 |
> | 2 | 112606305.00 |
> | 3 | 99175084.00 |
> | 4 | 101754796.00 |
> | 5 | 120049120.00 |
> | 6 | 138227787.00 |
> | 7 | 166565653.00 |
> | 8 | 136475650.00 |
> | 9 | 133242379.00 |
> +--------+--------------+
>
>
> When I run the same query in PHP (on a web site, I get):
>
> 4 538068.00
> 4 538068.00
> 4 538068.00
> 4 538068.00
> 4 538068.00
> 4 538068.00
> 4 538068.00
> 4 538068.00
> 4 538068.00
> 4 538068.00
> 4 538068.00
> 4 538068.00
>
> Why is this? What can be done to solve it?
>
> Any help or pointers welcome
>
Can you give us the php code for getting the query results and
generating the output ? Your error might well be the problem.
[Back to original message]
|