Ok, so what i have is a orders database which goes order number, customer number, product, quantity etc. now for each different product ordered, im entering a new row, and grouping them by order number- ie all products ordered at one time will have the same order no.
Problem is, when I come to display the orders tracking page, Im wanting to display:
Order 1
Product 1 - some info -
Product 2 - some info -
dispached etc.
Order 2
Product 1 - some info -
dispatched.
But since I have a whole bunch of rows which have the same order number, I need something like
while order number is (whatever the first order number that matches the customers id is) display this table with the info about those products.. then move on and do the same for the second order number. make sense?
code so far:
$getorders = mysql_query("SELECT * from orders where customer_no = '".$userrow['id']."'") or die(mysql_error());
if (mysql_num_rows($getorders) == 0) {
echo ("You currently have no orders.");
} else {
while ($orderrow = mysql_fetch_assoc($getorders)) {
//im not sure what should go here
}
}