nerd3d Posted December 25, 2004 Posted December 25, 2004 I would like to make my download lik a bit more descriptive my adding the text from the product atrtributes to the link text. I can see where to add it to modiles/download.php. I just can't figure out the SQL in that module. If someone could give me a hand with the SQL. I need to add the orders_product_attribute table to the query. Every time I try it I end up with all the downloads returned, not just the ones I want.
nerd3d Posted December 25, 2004 Author Posted December 25, 2004 Thought I should add my current feeble attempt at SQL, I can't seem to edit my own post so I'll add it here $downloads_query = tep_db_query("select o.orders_status, date_format(o.last_modified, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays, opa.products_options, opa.products_options_values from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd , " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " opa where o.customers_id = '" . (int)$customer_id . "' and o.orders_status >= '" . DOWNLOADS_CONTROLLER_ORDERS_STATUS . "' and o.orders_id = '" . (int)$last_order . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_filename != '' and op.orders_products_id = opa.orders_products_id" ); Thanks!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.