Scholieren.com forum

Scholieren.com forum (https://forum.scholieren.com/index.php)
-   Software & Hardware (https://forum.scholieren.com/forumdisplay.php?f=20)
-   -   [MySQL] Database aanmaken werkt niet (https://forum.scholieren.com/showthread.php?t=1188117)

flippje 26-05-2005 15:55

[Mysql] Database aanmaken werkt niet
 
CREATE TABLE `drugssmokkel` (
`drug` int(4) NOT NULL default '0',
`prijs` int(11) NOT NULL auto_increment,
`aantal` int(4) NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) TYPE=InnoDB ROW_FORMAT=COMPRESSED PACK_KEYS=0 AUTO_INCREMENT=9860 ;

Ik wil deze tabel invoeren in mijn database.
Maar krijg een error.
#1072 - Key column 'id' doesn't exist in table

Als ik , PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`) weghaal zegt ie :

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' TYPE = MYISAM PACK_KEYS =0 AUTO_INCREMENT =9860' at line 6

Het hoort toch wel te werken... Vind het vreemd, wat kan ik er aan doen?

Ik gebruik xampp.

Heb ook al geprobeerd het simpel te maken;

CREATE TABLE `drugssmokkel` (
`drug` int(4) NOT NULL default '0',
`prijs` int(11) NOT NULL auto_increment,
`aantal` int(4) NOT NULL default '0',
) AUTO_INCREMENT=9860 ;

Error:

#1064 - You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the
right syntax to use near ' AUTO_INCREMENT=9860' at line 5

Werkt niet dus...
Wat zou de oorzaak kunnen zijn?

eddie 26-05-2005 17:31

Citaat:

flippje schreef op 26-05-2005 @ 16:55 :
(...)
Wat zou de oorzaak kunnen zijn?

Euhm... lees de foutmelding?

flippje 26-05-2005 17:47

ja maar wat je ook doet. Het werkt maar nooit volgens mij

mvos100 26-05-2005 18:46

PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)

Hoe kan je iets toewijzen als die kolom niet eens bestaat :P

CREATE TABLE `drugssmokkel` (
`id` int(11) NOT NULL auto_increment,
`drug` int(4) NOT NULL default '0',
`prijs` int(11) NOT NULL auto_increment,
`aantal` int(4) NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) TYPE=InnoDB ROW_FORMAT=COMPRESSED PACK_KEYS=0 AUTO_INCREMENT=9860 ;

Probeer dat is

flippje 26-05-2005 21:44

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

Triloxigen 26-05-2005 21:59

Euh, ja die kun je toch wel oplossen? :|

flippje 26-05-2005 22:22

Gedaan maar blijven zelfde errors komen

Manuzhai 27-05-2005 06:11

Je kan wel bijzonder weinig, zeg.

CREATE TABLE `drugssmokkel` (
`id` int(10) unsigned NOT NULL auto_increment,
`drug` int(4) NOT NULL default '0',
`prijs` int(11) NOT NULL default '0',
`aantal` int(4) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=InnoDB ROW_FORMAT=COMPRESSED AUTO_INCREMENT=2 ;

Deze doet het bij mij; als ie het bij jou niet doet heb jij een archaische versie.

Triloxigen 27-05-2005 08:56

Citaat:

Manuzhai schreef op 27-05-2005 @ 07:11 :
Je kan wel bijzonder weinig, zeg.

Ik heb ook een beetje het gevoel alsof hij gewoon alles andere laat doen.. :|

Goes15 27-05-2005 10:06

Citaat:

********** schreef op 27-05-2005 @ 09:56 :
Ik heb ook een beetje het gevoel alsof hij gewoon alles andere laat doen.. :|
is toch nix mis mee

Ulfheðin 27-05-2005 10:19

Citaat:

Goes15 schreef op 27-05-2005 @ 11:06 :
is toch nix mis mee
Met je blauwe avatar

flippje 27-05-2005 10:21

Ja die lukt :D
Naja naar 500x proberen word je wel gek hoor

Triloxigen 27-05-2005 13:25

Citaat:

Goes15 schreef op 27-05-2005 @ 11:06 :
is toch nix mis mee
Ja, hallo..
Dit forum is om te helpen, niet om het te laten doen,,,


Alle tijden zijn GMT +1. Het is nu 14:45.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.