Jump to content

[SOLVED] Index Field


toxictoad

Recommended Posts

Hi,

 

I've created a Db using phpMyAdmin I've added the index field as the first field, with varchar(5),

 

Index:

Keyname  Type      Cardinality      Field

PRIMARY PRIMARY 1      index

 

I thought it would need to be set to auto_increment but when I tried I got this error

 

SQL query:

 

ALTER TABLE `dvds` CHANGE `index` `index` VARCHAR( 5 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AUTO_INCREMENT

 

MySQL said:

#1063 - Incorrect column specifier for column 'index'

 

So without auto_increment I added  new record but the index field was blank when I was expecting it to show 1

 

Can anyone see what I'm doing wrong?

 

Also what should the 'Collation' be set to or doesn't it matter?

Link to comment
https://forums.phpfreaks.com/topic/105482-solved-index-field/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.