A friend recently asked me to look at a site that he had developed in PHP, basically he is wanting to add some more details to an automated e-mail sent out.
In the e-mail he wants to include name, address, orderid, product description, quantity, price, totalprice and shipping.
This seems straight forward enough, but I need to be able to join the tables in SQL but I only know the memberid and the orderid.
Can anyone get me going with this, I have sat and stared at my screen for about 2 hours and drawn a blank so far. None of the code is commented so it is pretty difficult to understand what is going on.
Table Structure is like this:
MEMBERS
ID
firstname
surname
address1
address2
address3
address4
postcode
country
telephone
email
username
userpass
emailname
FINALISED ORDERS
ID
memberID
cartID
date
orderid
status
CARTS
ID
sessionid
ipaddress
completed
memberID
date
shippingID