Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with SQL coding


jdog2004

Recommended Posts

Posted

Im trying to modify the sales report 2 contribution a bit and need some insight for the correct sytex in an sql statement.

 

Im trying to add a SORT BY command to the following code:

// query for attributes
     $this->queryAttr = "SELECT count(op.products_id) as attr_cnt, o.orders_id, opa.orders_products_id, opa.products_options, opa.products_options_values, opa.options_values_price, opa.price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " opa, " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op WHERE o.orders_id = opa.orders_id AND op.orders_products_id = opa.orders_products_id";

 

I need it to order by the attribute_sort in the TABLE_ORDERS_PRODUCTS_ATTRIBUTES. Ive tried many times but keep getting a sytex error. Is it even possible to do this?

 

Thank You for any help !

Posted

So what code are you putting in to do sorting, and what sort of error are you getting? Show us the full code.

Archived

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

×
×
  • Create New...