if same product in multiple rows and contain invoice number

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinpkl
    New Member
    • Oct 2008
    • 41

    if same product in multiple rows and contain invoice number

    hi all

    i am filtering results of purchases made by customer.

    Code:
    $qry = "select * from mytable"
    $result = mysql_query($qry);
    while($row=mysql_fetch_array($result)
    {
    	echo $row['user_name'];
    	echo $row['product_name'];
    	echo $row['price'];
    	echo $row['quantity'];
    	echo $row['invoice_number'];
    	echo $row['status'];
    
    }


    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"

    Code:
    if(invoice number contained same product) 
    {
    	
    }
    vineet
    Attached Files
Working...