Forum Moderators: open
$select = "SELECT a.orders_id, a.customers_name, a.customers_street_address, a.customers_street_address_2, a.customers_city,
a.customers_postcode, a.customers_state, a.customers_country, a.customers_telephone, a.customers_email_address,
b.products_model, c.value FROM orders a LEFT JOIN orders_products b ON a.orders_id = b.orders_id LEFT JOIN orders_total c ON b.orders_id = c.orders_id
WHERE(
EXTRACT(MONTH FROM a.date_purchased) = EXTRACT(MONTH FROM CURDATE())
AND
DAYOFMONTH(a.date_purchased) = (DAYOFMONTH(CURDATE()) - 1)
)"; Now with this ginormous statement I also limit the c.value selection based on another field in the table. That being
c.title="total:" I have no idea how to go about doing this. I'm attempting to pull data from a db that's used by our shopping cart. And the shopping cart stores all totals that relate to a particular order in one table. I hope this isn't too confusing.