MySQL Error esx_advancedvehicleshop Script

CREATE TABLE vs_ambulance_categories (
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(60) NOT NULL,
label varchar(60) NOT NULL,

PRIMARY KEY (`name`)

);

Error = Error = # 1075 - Wrong table definition. There can only be one AUTO_INCREMENT column and this must be defined as a key

Hey ! :slightly_smiling_face:

If possible next time try to post your code in a more structured way, by just doing a screen of it (in the code editor) or by using the [ Preformatted text ] option when you write your post. It will be easier for others to read your code and help you that way and it you will certenly avoid some synthax error keeping things cleaner :wink:

Regarding you SQL issue, apparently you are trying to create a field id in AUTO_INCREMENT :

id int(11) NOT NULL AUTO_INCREMENT

And at the same time defining the field name as PRIMARY KEY :

PRIMARY KEY (name)

Usually we use the Id as the PRIMARY KEY if their is an Id.
Depending on the relations with the other tables in you database you could do somthing like this :

CREATE TABLE vs_ambulance_categories (
	id int(11) NOT NULL AUTO_INCREMENT,
	name varchar(60) NOT NULL,
	label varchar(60) NOT NULL,

	PRIMARY KEY (`id`)
);

Or somthing like this :

CREATE TABLE vs_ambulance_categories (
	id int(11) NOT NULL,
	name varchar(60) NOT NULL,
	label varchar(60) NOT NULL,

	PRIMARY KEY (`name`)
);

The option that you should choose (their is more than those two, but its the most basics) depend as I sayed earlier on the relations between the tables and also the way your script fetch the data in your table.

PS: It’s been a long time since I last did some SQL queryies sorry if it’s not the ideal answer :sweat_smile:

Peace !