It's the users referral id when they register through your auth system you assign it to them.
You can assign a unique number to it if you want, but then you would need to store that also.
We used a referred_users table that links to the users table.
Code:
-- --------------------------------------------------------
--
-- Table structure for table `referred_users`
--
DROP TABLE IF EXISTS `referred_users`;
CREATE TABLE IF NOT EXISTS `referred_users` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` BIGINT(20) UNSIGNED DEFAULT NULL,
`referreduser_id` BIGINT(20) UNSIGNED DEFAULT NULL,
`added_on` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE = MyISAM DEFAULT CHARSET = `utf8` COLLATE = `utf8_unicode_ci`;
--
-- Dumping data for table `referred_users`
--
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(55) NOT NULL,
`last_name` VARCHAR(55) DEFAULT NULL,
`gender` VARCHAR(8) DEFAULT NULL,
`activationkey` VARCHAR(255) DEFAULT NULL,
`password` VARCHAR(255) NOT NULL,
`email_address` VARCHAR(255) NOT NULL,
`group_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT '100',
`role` VARCHAR(15) DEFAULT NULL,
`remember_me` INT(1) UNSIGNED NOT NULL DEFAULT '0',
`date_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`confirmed` TINYINT(4) UNSIGNED DEFAULT '0',
`banned` TINYINT(4) UNSIGNED DEFAULT '0',
`deleted` TINYINT(4) UNSIGNED DEFAULT '0',
`facebook_id` VARCHAR(255) DEFAULT NULL,
`token` VARCHAR(255) DEFAULT NULL,
`timeout` INT(11) UNSIGNED DEFAULT '1800',
`user_url` VARCHAR(255) NOT NULL,
`receive_emails` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`read_terms` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`email_referral` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = `utf8` COLLATE = `utf8_unicode_ci`;
--
-- Dumping data for table `users`
--
But you can add to it if need be.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )