I'm still having issues with this. How exactly do you look up something in a table.
Right now I have this:
PHP Code:
if ($_SESSION['customer_id']) {
$name_query = "SELECT customers_firstname, customers_lastname, customers_email_address FROM " . TABLE_CUSTOMERS . " WHERE customers_id = :customersID";
$name_query = $db->bindVars($name_query, ':customersID', $_SESSION['customer_id'], 'integer');
$check_customer = $db->Execute($name_query);
$customer_email = $check_customer->fields['customers_email_address'];
$customer_name = $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
$country_query = "SELECT entry_country_id FROM " . TABLE_ADDRESS_BOOK . " WHERE customers_id = :customersID";
$country_query = $db->bindVars($country_query, ':customersID', $_SESSION['customer_id'], 'integer');
$check_customer = $db->Execute($country_query);
$customer_country = $check_customer->fields['entry_country_id'];
$country = zen_get_country_name($customer_country);
$state_query = "select address_book_id, entry_firstname as firstname, entry_lastname as lastname,
entry_company as company, entry_street_address as street_address,
entry_suburb as suburb, entry_city as city, entry_postcode as postcode,
entry_state as state, entry_zone_id as zone_id,
entry_country_id as country_id
from " . TABLE_ADDRESS_BOOK . "
WHERE customers_id = :customersID";
$state_query = $db->bindVars($state_query, ':customersID', $_SESSION['customer_id'], 'integer');
$check_customer = $db->Execute($state_query);
}
How do I add this:
PHP Code:
$_SESSION['customer_country_id'] = $check_country->fields['entry_country_id'];
$_SESSION['customer_zone_id'] = $check_country->fields['entry_zone_id'];
Bookmarks