help with mysql query
Posted: Tue May 12, 2020 2:05 am
I'm trying to tweak an ocmod I did a long time back and I'm adding a mysql query but am having problems with the syntax, wondering if anyone could help me out? I think it's something with the quotes in the code=shipping part but all the variations i' ve tried have failed me so far..
the working mysql version is:
I'm trying to get it into the PHP (with order_id variable) and am having issues near the =shipping part. I was trying something like:
Thanks!
the working mysql version is:
Code: Select all
SELECT * FROM order_total WHERE order_id = 123 AND code = "shipping";
Code: Select all
("SELECT * FROM " . DB_PREFIX . "order_total WHERE order_id = '" . (int)$order_id . "' . " AND code = 'shipping'");