jdog2004 Posted August 13, 2010 Posted August 13, 2010 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 !
MrPhil Posted August 13, 2010 Posted August 13, 2010 So what code are you putting in to do sorting, and what sort of error are you getting? Show us the full code.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.