Jump to content

[SOLVED] Cannot be null


zamp0e

Recommended Posts

I'm having an error when I try to set my 'id' column to null:

 

Error in query: INSERT into recept VALUES (NULL, 'Array', 'Array', 'CURDATE()',1,0,'Array'). Column 'id' cannot be null

 

What is the problem ? I'm sure that 'id' is auto_increment.

 

Thanks in advance.

Link to comment
Share on other sites

SELECT 'CURDATE()'; :

CURDATE()

CURDATE()

 

SELECT CURDATE(); :

CURDATE()

2009-06-07

 

I see your point, thanks.

 

And I've been using auto_increment before with NULL and it have been working, should I change ID to not be auto_increment ?

Link to comment
Share on other sites

Sorry, the table is actully name "users", misstyping.

 

users CREATE TABLE `users` (

`id` int(255) NOT NULL AUTO_INCREMENT,

`name` varchar(255) NOT NULL,

`password` varchar(255) NOT NULL,

`made` date NOT NULL,

`status` int(255) NOT NULL,

`antalrecept` int(255) NOT NULL,

`email` varchar(255) NOT NULL,

PRIMARY KEY (`id`)

) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.