468,539 Members | 1,690 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,539 developers. It's quick & easy.

if same product in multiple rows and contain invoice number

41
hi all

i am filtering results of purchases made by customer.

Expand|Select|Wrap|Line Numbers
  1. $qry = "select * from mytable"
  2. $result = mysql_query($qry);
  3. while($row=mysql_fetch_array($result)
  4. {
  5.     echo $row['user_name'];
  6.     echo $row['product_name'];
  7.     echo $row['price'];
  8.     echo $row['quantity'];
  9.     echo $row['invoice_number'];
  10.     echo $row['status'];
  11.  
  12. }
  13.  



See the screenshot for results displayed.

the product "samsung s4 white" is contained in two rows

but one row has invoice number and other row does not have invoice number.

So what i want is

if same product name is contained in two rows and one of them has invoice number
then these both rows should not get display and also the row containing same invoice number should not display.

means all 3 rows should be omitted.

so how to check that same product product is in another row but that row also contains invoice number.

so what should i write in the "if condition"

Expand|Select|Wrap|Line Numbers
  1. if(invoice number contained same product) 
  2. {
  3.  
  4. }
  5.  
vineet
Attached Images
File Type: jpg ct.jpg (25.8 KB, 88 views)
Aug 13 '16 #1
0 854

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Neil Zanella | last post: by
5 posts views Thread by Antanas | last post: by
3 posts views Thread by =?Utf-8?B?S2F5xLFoYW4=?= | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.