It looks like this is the piece of code you need to get the items for a particular order
// Retrieve Order Items
$sql = mysql_query("SELECT * FROM `order_line` WHERE `orderID` = ".$row['orderID']);
$sql then contains a result object (if there are any data found) or false (if no data)
You then need to retrieve all the rows, where each row contains an array of the all the fields in the row (because you did SELECT *)
You get the rows one at a time by repeatedly calling mysql_fetch_array() until it returns false.
while ($orderItems = mysql_fetch_array($sql)){
// $orderItems[0] now contains the first field of a row
// $orderItems[1] now contains the second field of a row. I guess this is the text you want.
// so on and so on
// This is where you could do something with a returned field of a row
// like add it to your output
$output[] = $orderItems[1];
}
the closing '}' now makes the "while" retrieve the next row
the "while" will terminate when there are no more rows
Good luck,
Barry.