Execute("SELECT restrict_to_categories FROM " . $oostable['coupons'] . " WHERE coupon_id='".$_GET['cid']."'"); $get_result = $coupon_get->fields; echo ""; $cat_ids = preg_split("/[,]/", $get_result['restrict_to_categories']); for ($i = 0; $i < count($cat_ids); $i++) { $sql = "SELECT c.categories_id, c.categories_status, cd.categories_name FROM " . $oostable['categories'] . " c, " . $oostable['categories_description'] . " cd WHERE c.categories_status = '1' AND c.categories_id = cd.categories_id AND cd.categories_languages_id = '" . intval($_SESSION['language_id']) . "' c.categories_id = '" . $cat_ids[$i] . "'"; $result = $dbconn->Execute($sql); if ($row = $result->fields) { echo "\n"; echo "\n"; echo "\n"; } } echo "

Valid Categories List

Category IDCategory Name
".$row["categories_id"]."".$row["categories_name"]."
\n"; ?>