Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: How many categories can an sNews site create?  (Read 3885 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
How many categories can an sNews site create?
« on: November 21, 2007, 07:52:30 PM »

;D   ;D  ;D  ;D I just couldn't help but try this out. I manually added a new category row to the categories table in a default sNews 1.6 project today, with an ID number of 999999... that's just 1 short of a million! It functions as well as any other category. So... we know we can create and delete at least 999,999 categories over the life-span of an sNews-powered site.

Why does this matter? - [EDIT] It doesn't. It was the first step in a hair-brained idea that was not worth sharing in the first place. The only thing confirmed is that sNews will pick up after 999,999 and number the next new category as the 1 millionth... and keep on going. Imagine that... a million-plus categories... yeah, right.  ;D
« Last Edit: November 22, 2007, 01:03:41 AM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: How many categories can an sNews site create?
« Reply #1 on: November 21, 2007, 09:31:53 PM »

And if after that insertion new category is created ... it continues with those low ID numbers?
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: How many categories can an sNews site create?
« Reply #2 on: November 21, 2007, 09:54:17 PM »

Aahha... no it does not. Thanks for the question codie... I just checked and the next category published gets the ID 1,000,000.
Which means... of course... having a far-off category ID number isn't even necessary. Oh well... if nothing else, we know that sNews will continue generating category ID numbers after the millionth category is published.  ;D

Question of the day: How does sNews number its categories... what gives it the memory to keep on going after 1 million? Is this controlled by an Apache server function... or a function within sNews itself?
« Last Edit: November 22, 2007, 01:03:10 AM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Joost

  • Guest
Re: How many categories can an sNews site create?
« Reply #3 on: November 22, 2007, 03:58:43 AM »

Question of the day: How does sNews number its categories... what gives it the memory to keep on going after 1 million? Is this controlled by an Apache server function... or a function within sNews itself?
Not Apache, nor sNews. Blame Mysql.
When creating tables in a mysql database, we also tell mysql how to behave.
Here is the code for creating categories:

Code: [Select]
CREATE TABLE categories (
  id int( 8) primary key auto_increment,
  name varchar(100) NOT NULL,
  seftitle varchar(100) NOT NULL,
  description varchar(255) NOT NULL,
  published varchar(4) NOT NULL default 'YES',
  catorder smallint(6) NOT NULL default '0',
lang varchar(6) default 'EN'

The second line (id int( 8 ) primary key auto_increment) tells mysql:
- The column 'id' can only contain a maximum amount of 8 digits How about category id 99,999,999? :)
- It is a primary key, meaning it cannot be empty and must be unique
- Assign a unique number (auto_increment)

varchar(100) Means: a max of 100 digits or characters are allowed.
NOT NULL default 'YES'. Means: there has to be a value. If sNews doesn't insert a value, then you (mysql)  will have to insert 'YES'.


Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: How many categories can an sNews site create?
« Reply #4 on: November 22, 2007, 02:22:54 PM »

Thanks for that explanation Joost... now it's clear to me. Time to learn more about SQL....  :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU