Magento Forum

Extract name, email and order ID from database for all orders
 
damianb123
Jr. Member
 
Total Posts:  9
Joined:  2011-11-14
 

Hi,
I need to extract the following for all orders in our magento 1.4.1.1 install:

Customer name
Customer email
Order ID

The trouble is many of our guests do not bother entering a firstname or lastname, so the sales_flat_order table contains NULL values for the name part - can I pull this from anywhere else?

This is the query I have been using:

SELECT increment_id, customer_email, customer_firstname, customer_lastname
FROM sales_flat_order
WHERE increment_id
BETWEEN ‘100023275 ‘
AND ‘100026149’

Any help greatly appreciated.

Cheers

Damian

 
Magento Community Magento Community
Magento Community
Magento Community
 
VnEcoms
Sr. Member
 
Avatar
Total Posts:  121
Joined:  2012-09-13
Vietnam
 

You can get other information from this table:
sales_flat_order_address
parent_id is foreign. it reference to entity_id of table sales_flat_order

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top