Grand Total Not working

Discussion in 'PHP' started by ashrafzia, May 19, 2008.

  1. #1
    Hi

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

    
    
    $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"; 
    
    
    PHP:
    I have checked the value in the where clause its working fine but still not working. i don't know why?
    Any idea!
     
    ashrafzia, May 19, 2008 IP
  2. relixx

    relixx Active Member

    Messages:
    946
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    70
    #2
    $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"
    ;


    Try that :)
     
    relixx, May 19, 2008 IP
  3. ashrafzia

    ashrafzia Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Still not working.....
     
    ashrafzia, May 19, 2008 IP
  4. relixx

    relixx Active Member

    Messages:
    946
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    70
    #4
    Are you sure that $_POST['c_id'] contains a value that MySQL can search for (ie, it's a value in the client_id column)?

    If it's not returning any errors, then it normally means that it wasn't able to find what it was asked to.
     
    relixx, May 19, 2008 IP