Automatically fixing item names in the catalogue

Results 1 to 3 of 3
  1. #1
    Member ExZachLy is offline
    MemberRank
    Sep 2011 Join Date
    60Posts

    Automatically fixing item names in the catalogue

    I made a simple SQL script that will update all of your catalog_items catalog_name to match the furni's public name. This specific code should work fine with MySql
    Arcturus
    Spoiler:
    Code:
    UPDATE catalog_items INNER JOIN items_base ON catalog_items.item_ids = items_base.id SET catalog_items.catalog_name = items_base.public_name

    Plus R2
    Spoiler:
    Code:
     UPDATE catalog_items INNER JOIN furniture ON catalog_items.item_id = furniture.id SET catalog_items.catalog_name = furniture.public_name



    For the newbies:
    Run this SQL using Navicat/phpmyadmin, go to your hotel and type :update catalog


  2. #2
    Gaby is offline
    MemberRank
    Apr 2013 Join Date
    Viva HollandiaLocation
    1,607Posts

    Re: Automatically fixing item names in the catalogue

    Be careful with that, catalog_items.item_ids isn't called item_IDS for nothing, it can contain multiple IDs semicolon separated.

  3. #3
    Member ExZachLy is offline
    MemberRank
    Sep 2011 Join Date
    60Posts

    Re: Automatically fixing item names in the catalogue

    Quote Originally Posted by Gaby View Post
    Be careful with that, catalog_items.item_ids isn't called item_IDS for nothing, it can contain multiple IDs semicolon separated.
    This is true. I haven't encountered any issues by using this code. But another query that only fixes names that are broken would be:
    Code:
    UPDATE catalog_items INNER JOIN items_base ON catalog_items.catalog_name = items_base.item_name SET catalog_items.catalog_name = items_base.public_name
    This takes much longer, but is more meticulous (Note: change the names of the columns to fit your database if you're not using Arcturus)



Advertisement