Hopefully this isn't a stupid question but I'm new to php and mysql and this is confusing the heck out of me. Can someone put me out of my misery and tell me why this doesn't work:
This select statement works fine -
$dl_wallet_sql = "select products_id, products_name FROM " . TABLE_ORDERS_PRODUCTS . ", " . TABLE_ORDERS . " WHERE orders_products.orders_id = orders.orders_id and orders.shipping_method = 'Download'";
This in fact returns 6 records (as expected). However if I use this -
$dl_shipping_way = 'Download';
$dl_wallet_sql = "select products_id, products_name FROM " . TABLE_ORDERS_PRODUCTS . ", " . TABLE_ORDERS . " WHERE orders_products.orders_id = orders.orders_id and orders.shipping_method = '" . $dl_shipping_way . "'";
This returns 1 (the first) record where in fact the shipping_method <> Download. Can someone please explain why it doesn't work and what the correct syntax should be. Unfortunately I need the second method to work because it gets the 'Download' text from a language file and I want language support.
Many thanks
Nigel
This select statement works fine -
$dl_wallet_sql = "select products_id, products_name FROM " . TABLE_ORDERS_PRODUCTS . ", " . TABLE_ORDERS . " WHERE orders_products.orders_id = orders.orders_id and orders.shipping_method = 'Download'";
This in fact returns 6 records (as expected). However if I use this -
$dl_shipping_way = 'Download';
$dl_wallet_sql = "select products_id, products_name FROM " . TABLE_ORDERS_PRODUCTS . ", " . TABLE_ORDERS . " WHERE orders_products.orders_id = orders.orders_id and orders.shipping_method = '" . $dl_shipping_way . "'";
This returns 1 (the first) record where in fact the shipping_method <> Download. Can someone please explain why it doesn't work and what the correct syntax should be. Unfortunately I need the second method to work because it gets the 'Download' text from a language file and I want language support.
Many thanks
Nigel