|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
mySQL multiple index'es
Is there anyway to have multiple indexes in a table.
The reason Im asking is because I want users to able to log in using username and not index number. I want to use both username and at the moment I have made some of the code based on ID number (row number). This does not work: SELECT * FROM user_info WHERE username=$username This is the table: CREATE TABLE user_info ( id int(11) NOT NULL auto_increment, firstname varchar(25) default NULL, lastname varchar(20) default NULL, email varchar(35) default NULL, credits int(11) NOT NULL default '500', username varchar(25) NOT NULL default '', password varchar(10) NOT NULL default '', url varchar(65) default NULL, sitetitle varchar(45) NOT NULL default '', description varchar(45) default NULL, progr_related tinyint(4) NOT NULL default '0', banner tinyint(4) default NULL, counter tinyint(4) default NULL, PRIMARY KEY (id), UNIQUE KEY id (id), FULLTEXT KEY email (email), FULLTEXT KEY email_2 (email), FULLTEXT KEY email_3 (email), KEY username (username) ) |
|
#2
|
|||
|
|||
|
RE: mySQL multiple index'es
Hi!
I think you confuse index with primary key. Indexes is used to speed up searches in columns. The primary key is used to get a specific id number for each row. Are you familiar with the "unsigned" command? I would also recommend you using "UNIQUE(column)" instead of key. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > mySQL multiple index'es |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|