Page 1 of 1

Grand Total Not working

Posted: Mon May 19, 2008 5:36 am
by ashrafzia
Hi

I am using the query for the grand total of the adjusted price.
Here's my query and it returns nothing:

Code: Select all

 
 
$sql = "SELECT service_ordered, admin_comments, adj_price, sum(adj_price) as tot_price
      from services_ordered where services_ordered.client_id=$_POST[c_id] 
          group by service_ordered"; 
 
 
I have checked the value in the where clause its working fine but still not working. i don't know why?
Any idea!

Re: Grand Total Not working

Posted: Mon May 19, 2008 8:13 am
by Glycerine
try putting single quotes around your $_POST[c_id]

Code: Select all

...ordered.client_id= '$_POST[c_id]'...
And for security reasons ensure you make the $_POST sql safe with striping before you submit it into your query. this would leave scope for sql injection attacks.