FRIHOST • FORUMS • SEARCH • FAQ • TOS • BLOGS • COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Table problem





frih
Here is a table--

Quote:

$movie = “CREATE TABLE movie (
movie_id int(11) NOT NULL auto_increment,
movie_name varchar(255) NOT NULL,
movie_type tinyint(2) NOT NULL default 0,
movie_year int(4) NOT NULL default 0,
movie_leadactor int(11) NOT NULL default 0,
movie_director int(11) NOT NULL default 0,
PRIMARY KEY (movie_id),
KEY movie_type (movie_type,movie_year)
)”;


t


I am unable to understand the purpose of last line-- "KEY movie_type(movie_type,movie_year)"

Why we have used KEY word. Is it creating primary key or so??

Need help--- I am new to mysql
kacsababa
The PRIMARY KEY line created the primary key, the key line created a key. Smile
The single KEY statement is same as INDEX.
If you don't know what indexes are then you should read about it. For example in the official manual.
Related topics
Forum Problem
Transparant Table
How Do You Center Your Entire Web Page?
ALTER TABLE mySQL problem.
Using <DIV> and <TABLE> both in a layout
Problem with static variable in class
Password problem
PHP homepage recreation problem
Padding or margin problem
URGENT! (fixed) (same problem again! not fixed)
Can't create mySQL table
Problem with Table {HTML}
mySQL create table problem (parse error)..
Table Problem
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.