Grand Total Not working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ashrafzia
Forum Commoner
Posts: 37
Joined: Wed Sep 28, 2005 12:23 pm

Grand Total Not working

Post 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!
Glycerine
Forum Commoner
Posts: 39
Joined: Wed May 07, 2008 2:11 pm

Re: Grand Total Not working

Post 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.
Post Reply