Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

phpadmin query to export stock


SCH_001

Recommended Posts

Hi every one, seeking a phpadmin query to export a selected category to excel

Need the following headers
Need the following headers - Category, Model, Name_en, Quantity, Image, Price, Weight, Description_en, Tax Class, Manufacturer

Many thanks

 

Link to comment
Share on other sites

I have got this far

SELECT p.products_model, pd.products_name, p.products_quantity, products_image, p.products_price, products_weight, products_tax_class_id, manufacturers_id
FROM products p, `products_description` pd
WHERE p.products_id = pd.products_id
AND pd.language_id = '1'

But still need the Category preferably by name and Description
Also need the Tax Class and Manufacturer as names not a number

Link to comment
Share on other sites

phpMyAdmin can export selected tables and fields as CSV files. It would give you the field names as the column headings, and the data as-stored as the entries. If you want custom headings and reformatted data entries, you'll have to write your own PHP (for example) code to read the table(s) and output the CSV as the format you want. Is that where you're heading on this? If the phpMyAdmin CSV is close enough, it might be easier to cobble up a post-processor to change column headings and replace data entries with new data (e.g., expand numbers into text fields).

Link to comment
Share on other sites

Ok in case anyone else wants this.

It will create a report giving c.categories_id, cd.categories_name, p.products_model, pd.products_name, p.products_quantity, products_image,   
    p.products_price, products_weight, pd.products_description, tc.tax_class_title, m.manufacturers_name

SELECT c.categories_id, cd.categories_name, p.products_model, pd.products_name, p.products_quantity, products_image,   
    p.products_price, products_weight, pd.products_description, tc.tax_class_title, m.manufacturers_name
FROM products p, products_description pd, products_to_categories p2c, categories c,
    categories_description cd, manufacturers m, tax_class tc
WHERE p.products_id = pd.products_id
    AND p.products_id = p2c.products_id
    AND p2c.categories_id = c.categories_id
    AND p2c.categories_id = cd.categories_id
    AND p.manufacturers_id = m.manufacturers_id
    AND p.products_tax_class_id = tc.tax_class_id
    AND p2c.categories_id = 322
    AND pd.language_id = '1'

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...