if ('category' === $category) {
    // Assume we have a valid category id
    $sql = 'SELECT name FROM ' . $xoopsDB->prefix('lxcategories') . ' WHERE categoryID = ' . $item_id;
    if (!$result = $xoopsDB->query($sql)) {
        redirect_header('index.php', 2, _ERRORS);