Modify

Opened 10 years ago

Closed 10 years ago

#771 closed Frage (fixed)

Frage bzgl. /includes/contact_us.php

Reported by: Torsten Riemer Owned by: somebody
Priority: normal Milestone: modified-shop-2.0.0.0
Component: Shop Version: 2.0.0.0
Keywords: Cc:
Blocked By: Blocking:

Description

Macht es nicht Sinn die zwei Queries in der "/includes/contact_us.php" zu kombinieren?

Derzeit:

    if (isset ($_SESSION['customer_id']) && !$error) {
      $customers_name = $_SESSION['customer_first_name'].' '.$_SESSION['customer_last_name'];
      $c_query = xtc_db_query("SELECT * FROM ".TABLE_CUSTOMERS." WHERE customers_id='".(int)$_SESSION['customer_id']."'");
      $c_data  = xtc_db_fetch_array($c_query);
      $email_address = stripslashes($c_data['customers_email_address']);
      $phone = stripslashes($c_data['customers_telephone']);
      $fax = stripslashes($c_data['customers_fax']);
      $address_query = xtc_db_query("select
                        entry_company,
                        entry_street_address,
                        entry_city,
                        entry_postcode
                        from " . TABLE_ADDRESS_BOOK . "
                        where customers_id = '" . (int)$_SESSION['customer_id'] . "'
                        and address_book_id = '" . (int)$_SESSION['customer_default_address_id'] . "'");
      $address_data = xtc_db_fetch_array($address_query);
      $company  = stripslashes($address_data['entry_company']);
      $street   = stripslashes($address_data['entry_street_address']);
      $postcode = stripslashes($address_data['entry_postcode']);
      $city     = stripslashes($address_data['entry_city']);
    }

Kombiniert:

    if (isset ($_SESSION['customer_id']) && !$error) {
      $customers_name = $_SESSION['customer_first_name'].' '.$_SESSION['customer_last_name'];
      $c_query = xtc_db_query("SELECT * FROM ".TABLE_CUSTOMERS." AS c
                                   LEFT JOIN ".TABLE_ADDRESS_BOOK." AS ab
                                          ON (ab.customers_id = c.customers_id)
                                       WHERE c.customers_id='".$_SESSION['customer_id']."'");
      $c_data  = xtc_db_fetch_array($c_query);
      $email_address = stripslashes($c_data['customers_email_address']);
      $phone   = stripslashes($c_data['customers_telephone']);
      $fax     = stripslashes($c_data['customers_fax']);
      $company  = stripslashes($c_data['entry_company']);
      $street   = stripslashes($c_data['entry_street_address']);
      $postcode = stripslashes($c_data['entry_postcode']);
      $city     = stripslashes($c_data['entry_city']);
    }

Attachments (0)

Change History (1)

comment:1 by Gerhard Waldemair, 10 years ago

Resolution: fixed
Status: newclosed

In 9612:

fix #771

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.