PDA

View Full Version : mySQL Error



adamFTW
13-12-2007, 09:38 PM
When I try to edit the database 'id', phpMyAdmin gives me the following error:



SQL query:
ALTER TABLE `petition` CHANGE `id` `id` VARCHAR( 30 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AUTO_INCREMENT
MySQL said:
#1063 - Incorrect column specifier for column 'id'

I'm trying to edit it so it's auto increment.

Moved by Agesilaus (Forum Moderator) from Design and Development: Please post in the correct forum.

Luno1599
13-12-2007, 09:42 PM
:S when i go on this it asks for a password :S in a popup box with cpanel login :S bug or summin?

adamFTW
13-12-2007, 09:44 PM
:S when i go on this it asks for a password :S in a popup box with cpanel login :S bug or summin?

I don't understand what you're saying, does that even have to do with this thread?

Joe!
13-12-2007, 09:45 PM
Well i got the same as them, I clicked this thread to view it and it asked for a cpanel password to deano.xplodehost.com or something?

adamFTW
13-12-2007, 09:47 PM
Oh, just refresh, I took out the cpanel thinger.

EDIT: I even dropped the whole table and created a ne wone, with the following code:



CREATE TABLE `petition` ( `id` varchar( 30 ) NOT NULL AUTO_INCREMENT '',
`name` varchar( 30 ) NOT NULL default '',
`grade` varchar( 30 ) NOT NULL default '',
`comment` varchar( 150 ) NOT NULL default '',
PRIMARY KEY ( `id` )
) TYPE = MYISAM


And it still says incorrect column specifier. :S

Ini
13-12-2007, 11:27 PM
Shouldn't have VARCHAR in it if i am correct

Try


ALTER TABLE `petition` CHANGE `id` `id` int(11) NOT NULL auto_increment

adamFTW
13-12-2007, 11:39 PM
No worries, fixed the problem a while ago. Thanks though!

Please close.

Edited by Agesilaus (Forum Moderator): Just as a reminder, we don't close threads by the request of the thread starter, if you wish to have the ability to close your own threads, you will have to purchase VIP by going to your Paid Subscriptions in your User CP.

Ini
13-12-2007, 11:44 PM
Just out of curiousity..

Was i right? lol

adamFTW
14-12-2007, 01:35 AM
I'm not sure, I fixed it a while before you posted.

Dentafrice,
14-12-2007, 01:38 AM
You have to have it set as the primary index/key first.

Want to hide these adverts? Register an account for free!