Datenabfrage aus 2 Tabellen

Selinaaa

Grünschnabel
Hallo :-)

Ich habe eine Frage- und zwar soll ich für einen Shop 2 Bestätigungsmails generieren (eine an den Kunden und eine an den Shopinhaber).
In der Mail soll der angegebene
Vorname
Nachname
E-Mail Adresse
Straße
PLZ
Wohnort
und die bestellten Artikel
definiert sein.

Soweit so gut... mein Problem liegt dann aber darin, dass alles außer der Mailadresse in der "address_book" Tabelle vorkommt - das lässt sich auch ganz gut einbauen:

PHP:
$address = tep_db_query("select entry_firstname as firstname, entry_lastname as lastname, entry_street_address as street_address, entry_suburb as suburb, entry_postcode as postcode, entry_city as city, entry_zone_id as zone_id, entry_country_id as country_id, entry_state as state from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "' and address_book_id = '" . $sendto . "'");

Jetzt frage ich mich aber wie ich dort die E-Mail hineinbekomme- die dazugehörige Tabelle heißt "customers".

Hoffe jemand kann mir weiterhelfen.... :(
 
also die Felder sind in der Costumers-Tabelle wiefolgt aufgeführt (falls du das meinst):
customers_id
customers_gender
customers_firstname
customers_lastname
customers_dob
customers_email_address
customers_default_address_id
customers_telephone
customers_fax
customers_password
customers_newsletter

Die Adress-Book Tabelle:
customers_id
address_book_id
entry_gender
entry_company
entry_firstname
entry_lastname
entry_street_address
entry_suburb
entry_postcode
entry_city
entry_state
entry_country_id
entry_zone_id

Gute Frage wie das ganze dann verknüpft ist :-S
Das Ganze ist von OS-Commerce programmiert falls das weiterhilft und die Datei heißt checkout_confirmation.php, ist in jedem OScommerce Packet Standart.
 
Zurück