Zen Follower
- Join Date:
- Jul 2012
- Posts:
- 347
- Plugin Contributions:
- 0
Coupon Restriction by Manufacturer
Ajeh:
Eeeks! I might have found it ... :eek:
You use prefixes on your database tables?
I tried adding prefix but still same thing. Just to make sure where should I add prefix in following lines:
if ($_GET['build_man'] > 0 && $_POST['products_drop'] == -1) {
// to insert new products from a given manufacturers_id for a coupon_code that are not already in the table
// products in the table from the manufacturers_id are skipped
$new_products_query = "select products_id from products where manufacturers_id = '" . $_GET['build_man'] . "' and products_id not in (select product_id from coupon_restrict where coupon_id = '" . $_GET['cid'] . "')";
$new_products = $db->Execute($new_products_query);
}
if ($_GET['build_man'] > 0 && $_POST['products_drop'] == -2) {
// to delete existing products from a given manufacturers_id for a coupon_code that are already in the table
// products in the table from the manufacturers_id are skipped
$new_products_query = "select products_id from products where manufacturers_id = '" . $_GET['build_man'] . "' and products_id in (select product_id from coupon_restrict where coupon_restrict = '" . $status . "' and coupon_id = '" . $_GET['cid'] . "')";
$new_products = $db->Execute($new_products_query);