473,379 Members | 1,216 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

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, 128 views)
Aug 13 '16 #1
0 1030

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

Similar topics

2
by: Neil Zanella | last post by:
Hello, I would like to know whether having a <table> element with two <tr> elements each containing one <td> elements and two <td> elements, respectively, is legal from the point of view of...
5
by: SSP | last post by:
Dear ASP.NETers, How would I insert multiple rows of data from a web form? Are there any tute's and stuff around. Couldn't find any myself. Thanks in advance. SSP
5
by: Antanas | last post by:
Is it possible to combine multiple rows returned from select statement into one row? SELECT NAME FROM TABLE1; I want all names to be combined into one row seperated by commas.
1
by: EORTIZ | last post by:
I need to find a way to import a file that has multiple rows per record. The number of rows may vary, but the lines have the same sequence. Here is an example of how the file looks: ...
3
by: =?Utf-8?B?S2F5xLFoYW4=?= | last post by:
In my project,i added datagridview to my form , i transfered my table to datagridview and added multiple rows and when i called dataadapther.update ,,result is ok. But when i tried it for the...
5
by: chrisbenett | last post by:
Hi all, I want to create an invoice number that looks like "YYMMDD01" which will increment with 1 for each invoice. But the next day, it will need to start at one again. Example: Today:...
1
by: PetroTiburcio | last post by:
Hi there, i have a gridview which populated via selected item on my drop down list which I don't have any problem with that. My problem is I am trying to save multiple rows on my gridview into my...
16
by: fyamoahaxracer | last post by:
Hi everyone, I have spent a few hours searching and cannot find an example that is similar enough for me to work with. Is it possible to combine multiple rows by creating new columns? Searching...
3
by: wirejp | last post by:
Referencing post: -http://bytes.com/topic/access/answers/779498-sum-access-report-repeating-invoice I need some help with the calculation of invoice amounts on a Microsoft Access 2010 report. My...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.