Jump to content
php.lv forumi

Kas ma te nepareizi


fearless

Recommended Posts

CREATE TABLE `users` (

`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,

`username` VARCHAR( 30 ) NOT NULL ,

`password` CHAR( 40 ) NOT NULL ,

`email` VARCHAR( 70 ) NOT NULL ,

`active` CHAR( 32 ) NOT NULL

) ENGINE = innodb

 

MySQL said: Documentation

#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key

Link to comment
Share on other sites

fearless -->

lai izmantotu AutoIncramet lauks ir jadifine kaa atslega ...

tev tachu skaidri un gaishi uzrakstiits (izlasi ko SQLs tev saka)

 

truukst PRIMARY KEY ( `id` )

CREATE TABLE `test` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`kautkas` VARCHAR( 250 ) NOT NULL ,
`kautkas2` DATE NOT NULL ,
`kautkas3` TEXT NOT NULL ,
PRIMARY KEY ( `id` )
) TYPE = innodb;

Link to comment
Share on other sites

Nu moins :)

 

Tev jāievieto tas PRIMARY KEY ( `id` ) tur kur Grey_Wolf ir norādījis.

 

CREATE TABLE `users` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`username` VARCHAR( 30 ) NOT NULL ,
`password` CHAR( 40 ) NOT NULL ,
`email` VARCHAR( 70 ) NOT NULL ,
`active` CHAR( 32 ) NOT NULL,
PRIMARY KEY ( `id` )
) ENGINE = innodb

Link to comment
Share on other sites

×
×
  • Create New...