1
jfmoore
mx-Directory file MXDIR_cats.sql
  • 2005/9/26 19:53

  • jfmoore

  • Quite a regular

  • Posts: 360

  • Since: 2004/6/6 5


Tripmon has very graciously supplied with mx-Directory a file named MXDIR_cats.sql containing sample categories to be inserted into the database. Here are some sample lines of code from the file showing a few top-level categories and a few sub-categories:

INSERT INTO XSM_xdir_cat VALUES (1540'Art and Collectibes''http://');
INSERT INTO XSM_xdir_cat VALUES (1550'Automotive''http://');
INSERT INTO XSM_xdir_cat VALUES (1560'Community''http://');
INSERT INTO XSM_xdir_cat VALUES (1570'Computers and Internet''http://');
INSERT INTO XSM_xdir_cat VALUES (175154'Antiques''');
INSERT INTO XSM_xdir_cat VALUES (176154'Artists''');
INSERT INTO XSM_xdir_cat VALUES (177154'Crafts and Hobbies''');
INSERT INTO XSM_xdir_cat VALUES (178154'Fine Art''');
INSERT INTO XSM_xdir_cat VALUES (179154'Fine Jewelry''');


I would like to change this file to contain my category list, and I am wondering what the rules are concerning the numbering sequence.

For example, Tripmon begins with number 154 for the first main category. Is there a reason for this particular number?

Also, could I number the main categories like 160, 170, 180, etc., so as to leave room to insert other categories later if necessary should I think of something to add before the file is finalized? Or must they be consecutive right from the start?

Also, could the numbering system contain, say, 4 digits instead of 3?

And, if there are third level categories, what would the syntax be?

Any suggestions as to how best to layout this file will be very much appreciated.

JFM
...

2
tripmon
Re: mx-Directory file MXDIR_cats.sql
  • 2005/11/2 21:36

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


Hi JFM,

You can use any numbers you wish and there will be no ill effects.

The only thing you need to be concerned about is the Sub-Cats being correctly linked to the Parent Cat.

There was no real reason for the numbering, I just ran a drop of my current Dir structure from MyAdmin and that happened to be the Category ID's.

You should also not need to leave spaces for later inserts.

PM me if you have any other questions or problems.

3
wtravel
Re: mx-Directory file MXDIR_cats.sql

If the first column is an auto incremented field, it does not matter which number you put in there. MySQL will ignore the number of the category and automatically use the first available number for that record.

Login

Who's Online

380 user(s) are online (70 user(s) are browsing Support Forums)


Members: 0


Guests: 380


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits