Jump to content

[SOLVED] report products or cumulate same rows


sheriff

Recommended Posts

hi all ...

 

I have a list generated from mysql with products what have not delivered to customers.

 

how can i tell to php or mysql  ??? to cumulate the items with the same id and to calculate the quantity of the items ?

exemple:

 

Nr.    ID      The product                        UM    QTY    ord nr

1  88  Antene pentru plase volei  per  2  767762

2 88 Antene pentru plase volei  per 1 791688

3 305 Aparat de măsurat detenţa  buc 1 264954

4 305 Aparat de măsurat detenţa  buc 2 659272

5 286 Aparat de ramat HAMMER buc 2 767762

6 286 Aparat de ramat HAMMER buc 1 419495

7 286 Aparat de ramat HAMMER buc 1 430298

8 286 Aparat de ramat HAMMER buc 1 219941

9 286 Aparat de ramat HAMMER buc 7 825287

10 286 Aparat de ramat HAMMER buc 1 791688

 

and i want to show something like:

1  88  Antene pentru plase volei  per  3  767762

2 305 Aparat de măsurat detenţa  buc 3 264954

35 286 Aparat de ramat HAMMER buc 13 767762

 

the code what i use now:

 

$query = "select prod_com.pr_id, prod_com.ord_nr, prod_com.cmd_id, prod_com.pr_qty, products.pr_name, products.pr_desc, products.pr_um, products.pr_price from prod_com, products WHERE prod_com.pr_id=products.pr_id and prod_com.pr_id=prod_com.pr_id and prod_com.pr_date_deliv is NULL ORDER BY products.pr_name";

 

thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.