Grouping data

Hello, I am having problems with displaying grouped records from mysql and could desperately use help. In the example below, I want to display the Order Number ONCE and ALL the records associated with that order. Then carry on to the next record and so on. Here is a sample of what the output is suppose to be. Can anyone help me with this. The key being to not display the Order Number on every line.

tblName1.OrderNumber tblName2.Name tblName2.Price

12653 PBXL 396.52
ABCD 426.28
GEDL 385.20

12654 ABCD 515.18
FGHL 520.00

12659 PBXL 612.35
FGHL 619.20
XTRL 420.39

Thanks.

First of all, order the rows by Order number in your query.
Second, in PHP, outside of the while loop initialize a variable where you’ll store the ‘current order number’. Inside the loop, check if the order number from the row equals the one stored in the variable. If not, display it and store it in the variable.