Jump to content
×
×
  • Create New...

Order Items in Shop According to ID


Chriss

Recommended Posts

Spoiler

204014280efe73cd8ce1b2e253e352b1e56c40.p

 

ClientManagerBoot.cpp

 

//search

    static const char * s_szQuery =
        "SELECT "
        "shop.vnum, "
        "shop.npc_vnum, "
        "shop_item.item_vnum, "
        "shop_item.count "
        "FROM shop LEFT JOIN shop_item "
        "ON shop.vnum = shop_item.shop_vnum ORDER BY shop.vnum, shop_item.item_vnum";

 

//replace or adapt:

    static const char * s_szQuery =
        "SELECT "
        "shop.vnum, "
        "shop.npc_vnum, "
        "shop_item.item_vnum, "
        "shop_item.count "
        "FROM shop LEFT JOIN shop_item "
        "ON shop.vnum = shop_item.shop_vnum ORDER BY shop.vnum, shop_item.id";    // shop_item.item_vnum - shop_item.id

 

shop_item.sql

 

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for shop_item
-- ----------------------------
DROP TABLE IF EXISTS `shop_item`;
CREATE TABLE `shop_item` (
  `id` int(10) UNSIGNED NOT NULL DEFAULT 1,
  `shop_vnum` int(11) NOT NULL DEFAULT 0,
  `item_vnum` int(11) NOT NULL DEFAULT 0,
  `count` tinyint(4) unsigned NOT NULL DEFAULT 1
) ENGINE = MyISAM CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Fixed;

-- ----------------------------
-- Records of shop_item
-- ----------------------------
INSERT INTO `shop_item` VALUES (1, 1, 1009, 1);
INSERT INTO `shop_item` VALUES (2, 1, 297, 1);
INSERT INTO `shop_item` VALUES (3, 1, 4049, 1);
SET FOREIGN_KEY_CHECKS=1;

 

  • Love 5
Link to comment
Share on other sites

  • 5 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.