csabi_fl Posted November 1, 2006 Share Posted November 1, 2006 Hi everyone.I have a table in my database with the following fields:counter,loginid,password,email and country.I don't know how to set up the indexes for the proper table structure.I have set up 'loginid' to be unique,but what else?Please advise.Thank you. Link to comment https://forums.phpfreaks.com/topic/25810-mysql-table-help/ Share on other sites More sharing options...
craygo Posted November 1, 2006 Share Posted November 1, 2006 Usually you have a unique id, then a username, password, e-mail, ect, ectHere is an export of one of my tables[code]CREATE TABLE `employees` ( `EmployeeID` int(11) unsigned NOT NULL auto_increment, `FirstName` varchar(50) default NULL, `LastName` varchar(50) default NULL, `Initials` varchar(50) default NULL, `userid` varchar(100) default '', `password` varchar(100) default '', `accessrights` varchar(50) default '1', `active` tinyint(1) NOT NULL default '1', `email` varchar(50) default NULL, PRIMARY KEY (`EmployeeID`), UNIQUE KEY `unique` (`userid`)) ENGINE=MyISAM;[/code]With this you have a unique key "EmployeeID" and also a unique username. You can obviously change the field names and such to your needs.Ray Link to comment https://forums.phpfreaks.com/topic/25810-mysql-table-help/#findComment-117871 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.