﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking
771	Frage bzgl. /includes/contact_us.php	Torsten Riemer	somebody	"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']);
    }
}}}
"	Frage	closed	normal	modified-shop-2.0.0.0	Shop	2.0.0.0	fixed				
