I have a query of creating a table user its not executing in PHPMyAdmin of XAMPP. Here is the query,
create table user (#user_id bigint unsigned primary key not null auto_increment,
email text not null,
phone text primary key not null,
gcm_id bigint unsigned,
name text,
age_group text,
landmark text,
appartment text,
country text,
adults int,
kids int,
workstation text,
lati decimal(9,6),
longi decimal(9,6),
pincode text,
brand_id bigint unsigned,
branch_id bigint unsigned,
app_money decimal(7,2),
member boolean,
checked_in boolean,
index user_table_index1(email(50), phone(20))
);
Its showing #1170 - BLOB/TEXT column 'phone' used in key specification without a key length. Since its a TEXT datatype ,why key length is needed? What does the Key length here means?
Answer:
Text datatype cannot be used as Primary Key You need to use varchar with length instead.
No comments:
Post a Comment