Guest Posted November 19, 2006 Posted November 19, 2006 in this query: $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_lastname"; $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); how can i output the number of orders?
Guest Posted December 1, 2006 Posted December 1, 2006 i get: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /test.php on line 70
kagg Posted December 1, 2006 Posted December 1, 2006 This does not seem to be a correct query. customers_id in orders table are not "null" $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_lastname";
Guest Posted December 1, 2006 Posted December 1, 2006 odd, i never noticed that. i pulled this code from a contribution i'm using.. and i deleted: where o.customers_id is NULL which seemed to have worked, cause the database stopped responding for a bit (the database is HUGE) is there a way to lessen the load while still grabbing the order counts?
kagg Posted December 1, 2006 Posted December 1, 2006 Do you want to count the total number of orders in your shop?
Guest Posted December 1, 2006 Posted December 1, 2006 no, just the number of orders the customer has done. i am using this contribution: http://www.oscommerce.com/community/contri...h,inactive+user and am looking for a more manual way of deleting useless accounts. i try to keep all accounts that have at least 1 order and are subscribed to the newsletter
Recommended Posts
Archived
This topic is now archived and is closed to further replies.