ForumübersichtPHP & MySQL

mysql fehler? - Seite 1

Einloggen
Benutzername:
Passwort:

Passwort vergessen?
Kostenlos
Anmelden
Geschlossen
AutorText


Distorsn



Punkte: 261
hallo foren gemeinde Smily NR:2 ich habe ein kleines problemchen mit meiner db ich hoffe ihr könnt mir helfen Smily NR:2

ich gebe folgendes in meine db ein:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
CREATE TABLE accounts (
    name varchar (255) NOT NULL,
    prename varchar (255) NOT NULL,
    id int(10) DEFAULT '0' NOT NULL auto_increment,
    password varchar (255) NOT NULL,
    email varchar (255) NOT NULL,
    url varchar (255) NOT NULL,
    showup tinyint (1) DEFAULT '0' NOT NULL,
    points int (10) DEFAULT '0' NOT NULL,
    views int (10) DEFAULT '0' NOT NULL,
    hits int (10) DEFAULT '0' NOT NULL,
    recently text,
    sessionid varchar (255),
    lastview int (10) DEFAULT '0' NOT NULL,
    PRIMARY KEY id (id),
    UNIQUE id  (id),
);


leider kommt immer wieder diese meldung Smily NR:9

1
#1067 - Invalid default value for 'id'


kann mir bitte mal einer sagen wo ich da den fehler habe?

danke an euch und schönes we



Sniper
Super-Moderator



Punkte: 3578
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
CREATE TABLE accounts (
    name varchar (255) NOT NULL,
    prename varchar (255) NOT NULL,
    id int(10) NOT NULL auto_increment,
    password varchar (255) NOT NULL,
    email varchar (255) NOT NULL,
    url varchar (255) NOT NULL,
    showup tinyint (1) DEFAULT '0' NOT NULL,
    points int (10) DEFAULT '0' NOT NULL,
    views int (10) DEFAULT '0' NOT NULL,
    hits int (10) DEFAULT '0' NOT NULL,
    recently text,
    sessionid varchar (255),
    lastview int (10) DEFAULT '0' NOT NULL,
    PRIMARY KEY id (id),
    UNIQUE id  (id),
);

Versuchs mal so , ich denke nicht das es gewollt is das ID automatisch 0 ist Smily NR:7 id = 1 , 2 automatisch ... halt


Liebe Grüße
Sniper

Bei Fragen oder Probleme PM me oder schreib in das Forum


Distorsn



Punkte: 261
danke für deine schnelle hilfe aber leider kommt nun diese fehlermeldung:

1
2
3
#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 ')' at line 17


<editiert am 20.01.12 um 22:42 von Distorsn>



Sniper
Super-Moderator



Punkte: 3578
...nun so wirds gehn Smily NR:7

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
CREATE TABLE `accounts` (
    `name` varchar (255) NOT NULL,
    `prename` varchar (255) NOT NULL,
    `id` int(10) NOT NULL AUTO_INCREMENT,
    `password` varchar (255) NOT NULL,
    `email` varchar (255) NOT NULL,
    `url` varchar (255) NOT NULL,
    `showup` tinyint (1) DEFAULT '0' NOT NULL,
    `points` int (10) DEFAULT '0' NOT NULL,
    `views` int (10) DEFAULT '0' NOT NULL,
    `hits` int (10) DEFAULT '0' NOT NULL,
    `recently` text,
    `sessionid` varchar (255),
    `lastview` int (10) DEFAULT '0' NOT NULL,
PRIMARY KEY ( `id` )
) TYPE = MYISAM ;


Liebe Grüße
Sniper

Bei Fragen oder Probleme PM me oder schreib in das Forum


Distorsn



Punkte: 261
Danke euch hat funktioniert

Geschlossen