Alright, I have not been able to get it to work at all. I went back to the drawing board and simplified my statements so that I can get through it but still no luck.
First thing is my select statement
PHP Code:
$order_text = "SELECT o.orders_id, customers_email_address, customers_telephone, order_total, products_name, op.products_price, final_price, op.products_quantity, date_purchased, orders_products_id, o.orders_status, o.payment_method, op.products_id";
$order_text = $order_text . " FROM (". TABLE_ORDERS ." o LEFT JOIN ". TABLE_ORDERS_PRODUCTS ." op ON o.orders_id = op.orders_id)";
$order_text = $order_text . " WHERE date_purchased >= $str_startdate";
$order_text = $order_text . " AND date_purchased < $str_enddate";
That records by oddly enough it shows the first line as order 1 but then the next line shows order 1 followed by order 2, and the third line shows order1, 2, 3 and keeps on going like that.
the end result that I am trying to achieve is like this
OID-----Line#----Text
100-----001-----
[email protected]
100-----002----- 2 x Kitkat Bars
100-----003----- 2 x Mars Bar
100-----004----- Final Price $4
101-----001-----
[email protected]
101-----002----- 2 x Bounty Bars
101-----003----- Final Price $2
etc.
Bookmarks