Hi, yes I do know, I'm passing their ID through the browser. It's only a small inhouse system that I'm developing. I think I have managed to join all the tables but now one of my while loops does not work (though that's a separate matter).
$sql = mysql_query("SELECT order_products.* , orders.*, customers.* FROM orders LEFT JOIN order_products ON orders.receipt_id = order_products.receipt_id LEFT JOIN customers ON customers.customer_ref=order_products.customer_id WHERE orders.receipt_id='$_GET[ref]' AND orders.cust_ref='$_GET[id]'");
$sql = mysql_fetch_array($sql);