1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mass Create Categories

Discussion in 'Media Gallery Support' started by Brent W, Feb 18, 2015.

  1. Brent W

    Brent W Well-Known Member

    If I had a list of categories I wanted to create is there an easy way to do this? Talking over 200 categories. SQL query?
  2. Chris D

    Chris D XenForo Developer Staff Member

    Nothing special, really. Just a basic:

    INSERT INTO xengallery_category
       (a, b, c)
       (1, 2, 3),
       (4, 5, 6)
    Where a, b, c are column names and 1, 2, 3 are values for one category and 4, 5, 6 are values for another category. Bear in mind you won't necessarily need to define all columns and values for all columns in that table. Some columns may have default values that are acceptable, e.g. the category_description field has a default value of 'blank' so if none of the categories need descriptions then you won't need to enter that in the query.
    Brent W likes this.

Share This Page