its my Data base structure , I want to create login for admin , franchisor , distributor , seller , its gives me a problem that when i take a user name 'David' for franchisor then can i also registor 'David' as a seller .
i want a user name piked up for any kind of user name will not be repeat in my data base . i have already take it with 5 tables bt its presist proble .

CREATE TABLE IF NOT EXISTS `members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `country` varchar(255) NOT NULL,
  `state` varchar(255) NOT NULL,
  `city` varchar(255) NOT NULL,
  `bio` text NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `signupdate` datetime NOT NULL,
  `lastlogin` datetime NOT NULL,
  `accounttype` enum('a','b','c','d','e') NOT NULL,
  `emailactivated` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

Recommended Answers

All 3 Replies

So if i understand, it lets you create more than one user with the same name ?

i want to creat a single username in my data base
if ' James " already taken then it will not be register for franchisor , distributor , seller

Line 16 above does just that. But that won't work if you are using multiple tables.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.