This is my billing table in my sql:
id pid quantity total discount price customer
1 1 2 20.00 5.00 15 a
2 1 2 20.00 3.00 17.00 a
3 2 3 15.00 2.00 13.00 b
4 3 1 2.00 1.00 1.00 a
This is my product master table
id name mrp
1 pen 10.00
2 pencil 5.00
3 rubber 2.00
From these two tables I got output like this. Using this query $res=mysql_query("select productmaster.name, billing.quantity,billing.total,billing.discount,billing.price from productmaster INNER JOIN billing on productmaster.id= billing.pid");
name quantity total discount price
pen 2 20.00 5.00 15
pen 2 20.00 3.00 17.00
pencil 3 15.00 2.00 13.00
rubber 1 2.00 1.00 1.00
and I want to get outputlike this .How ? Can any one do help? its urgent,....
name quantity total discount price
pen 4 40.00 8.00 32.00
pencil 3 15.00 2.00 13.00
rubber 1 2.00 1.00 1.00