MoisesZaragoza Posted February 15, 2006 Posted February 15, 2006 is there a way I can get the customer informarion like Name address city State phone e-mail off all the custumers arange by date? at the end of the day the code will be good
moonstone Posted February 16, 2006 Posted February 16, 2006 If you are going to do this on a regular basis, I'll suggest you create a php file for it. Unfortunately, this means you'll need to know how to write PHP codes. If you are doing it just occasionally, then using phpMyAdmin is a good way. Simply select your database from the pulldown menu on the left column, then click on SQL tab at the top. In the run SQL query/queries box, paste the following codes and click on Go button: select concat(c.customers_lastname,', ',c.customers_firstname) as full_name, a.entry_street_address, a.entry_city, a.entry_state, c.customers_telephone, c.customers_email_address from customers c, address_book a, customers_info ci where c.customers_id = a.customers_id and c.customers_id = ci.customers_info_id order by ci.customers_info_date_account_created I hope this is what you're looking for... :blush:
MoisesZaragoza Posted February 16, 2006 Author Posted February 16, 2006 Thanks for your help but I'm gettig a error unexpected T_STRING in /home/vitamin/public_html/admin/CustomerInfo.php on line 11 at the end of the day the code will be good
MoisesZaragoza Posted February 16, 2006 Author Posted February 16, 2006 <?php 12 require('includes/application_top.php'); 3 require(DIR_WS_CLASSES . 'currencies.php'); 4 $currencies = new currencies(); 5 $orders_statuses = array(); 6 $orders_status_array = array(); 7 8 9 10 11 $orders_query = tep_db_query(select concat(c.customers_lastname,', ',c.customers_firstname) as full_name, a.entry_street_address, a.entry_city, a.entry_state, c.customers_telephone, c.customers_email_address from customers c, address_book a, customers_info ci where c.customers_id = a.customers_id and c.customers_id = ci.customers_info_id order by ci.customers_info_date_account_created); 12 $row_orders_query = mysql_fetch_assoc($orders_query); 13 $totalRows_orders_query = mysql_num_rows($orders_query); 14 $order_exists = true; 15 16 17 ?> at the end of the day the code will be good
moonstone Posted February 16, 2006 Posted February 16, 2006 Check your syntax. Query should be enclosed with double quotes. In your case, it should be: $orders_query = tep_db_query("select concat(c.customers_lastname,', ',c.customers_firstname) as full_name, a.entry_street_address, a.entry_city, a.entry_state, c.customers_telephone, c.customers_email_address from customers c, address_book a, customers_info ci where c.customers_id = a.customers_id and c.customers_id = ci.customers_info_id order by ci.customers_info_date_account_created"); And since you are using a php file and not a direct SQL query from phpMyadmin, you may change the above line to the following if you wish to follow the osCommerce standard: $orders_query = tep_db_query("select concat(c.customers_lastname,', ',c.customers_firstname) as full_name, a.entry_street_address, a.entry_city, a.entry_state, c.customers_telephone, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " a, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = a.customers_id and c.customers_id = ci.customers_info_id order by ci.customers_info_date_account_created");
Recommended Posts
Archived
This topic is now archived and is closed to further replies.