/    Sign up×
Community /Pin to ProfileBookmark

I’m getting te same fault everytime..never had it before what could be wrong??

SQL-query_:_

CREATE TABLE Reactie(
id tinyint( 4 ) DEFAULT ‘0’ NOT NULL AUTO_INCREMENT ,
Voornaam varchar( 30 ) ,
Achternaam varchar( 30 ) ,
Datum DATE( ) ,
Wie varchar( 30 ) ,
Afdeling varchar( 30 ) ,
Link1 varchar( 30 ) ,
Link2 varchar( 30 ) ,
Link3 varchar( 30 ) ,
Tekst LONGTEXT( ) ,
PRIMARY KEY ( id ) ,
UNIQUE id( id )
)

This is the error
#1067 – Invalid default value for ‘id’

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@scragarNov 25.2004 — try the SQL without the quotes around 0, remember 0 is a number not a string.
Copy linkTweet thisAlerts:
@zebdaagauthorNov 25.2004 — no doesn't work
Copy linkTweet thisAlerts:
@zingmatterNov 25.2004 — Space between 'Reactie' and opening bracket? Just a thought.
Copy linkTweet thisAlerts:
@scragarNov 25.2004 — try making ID a diferent case, that could be (but I doubt it) a problem.

Another thing you might want to try is completely removeing the default for ID, since it's auto-increment its default is always 1 more than the previous.

If I think of anything else to try I post it....
Copy linkTweet thisAlerts:
@DJsACNov 25.2004 — id tinyint( 4 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ,[/QUOTE]
Think about it.

Auto increment, *add 1 to the previous value*

1,2,3,4,5

Default 0 --> auto increment is nolonger possible because the value = 0 unless you tell it otherwise.

Not NULL --> Default '0' is not possible because '0' == NULL.

You're trying to tell the database to Add 1 to the previous row, Use 0, but not accept 0 as a value :eek:

What do you want??? ?
Copy linkTweet thisAlerts:
@zebdaagauthorNov 25.2004 — i deleted the default '0' and everything is okay now

thanks for al the help!
×

Success!

Help @zebdaag spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...