Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

what's wrong with this query?


Guest

Recommended Posts

what i'm trying to do: display the order count on inactive users page (contribution)

 

 

 

this code works to display order count on admin/customers.php:

	  $cusomers_order_count_query_raw = "select count(*) from orders where customers_id = " . $customers['customers_id'];
  $customers_order_query = tep_db_query($cusomers_order_count_query_raw);
  $order_count = tep_db_fetch_array($customers_order_query);

 

 

 

but it doesn't on inactive users page.

 

 

here is the queries from inactive users:

$cust_query = tep_db_query("select customers_firstname, customers_lastname, customers_telephone from " . TABLE_CUSTOMERS . " where customers_id = '" . $_GET['id'] . "'");
$cust = tep_db_fetch_array($cust_query);

 

and

 

  $siu_query_raw = "select ci.customers_info_date_of_last_logon, c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address, c.customers_newsletter, c.customers_telephone from " . TABLE_CUSTOMERS_INFO . " ci, " . TABLE_CUSTOMERS . " c left join " . TABLE_ORDERS . " o on c.customers_id = o.customers_id where o.customers_id is NULL and c.customers_id = ci.customers_info_id order by c.customers_id";
 $siu_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $siu_query_raw, $siu_query_numrows );
 $siu_query = tep_db_query($siu_query_raw);

 while ($customers = tep_db_fetch_array($siu_query)) {

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...