Enzo_UK Posted September 7, 2008 Posted September 7, 2008 I need a way of getting the Fax number displayed on the invoice, but am having a few problems... The main problem is the Fax number is not stored in the table 'orders' along with the rest of the customer details when they place the order, it just stays in table 'customers' Any help is greatly appreciated.
Enzo_UK Posted September 7, 2008 Author Posted September 7, 2008 I have finally come up with a way to do it... its probably not the greatest of ways, but it works... <?php $sql="SELECT customers_id FROM orders where orders_id = '$oID'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ $customer_id = $row["customers_id"]; } $sql="SELECT customers_fax FROM customers where customers_id = '$customer_id'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ $customer_fax = $row["customers_fax"]; } echo ("$customer_fax"); ?> If anyone has got a way of tidying that up at all, please let me know.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.