NOT NULL constraint failed
#6

Quote:
Originally Posted by Biesmen
Посмотреть сообщение
You have indeed specified column "origicloc" not to be null. That's why you get this error. MySQL is basically telling you there's a column which is not allowed to be null. But you're basically entering 'null' as content/data for that column. You'll have to give that column a default value, or enter a value for that column in the query, or you'll have remove the NOT NULL constraint.

Replacing
Код:
origloc VARCHAR(30) NOT NULL
with
Код:
origloc VARCHAR(30) NOT NULL DEFAULT ''
will do the trick, or you'll have to enter a value for that column in the query:
Код:
INSERT INTO `users` (`username`,`password`,`origloc`) VALUES ('%s','%s','any content here')
Yep that fixed the issue that I had, thanks a lot man. I use SQLite btw but there is not much difference I suppose. +REP.
Reply


Messages In This Thread
NOT NULL constraint failed - by DarkLored - 03.04.2016, 04:48
Re: NOT NULL constraint failed - by Vince - 03.04.2016, 10:04
Re: NOT NULL constraint failed - by Biesmen - 03.04.2016, 10:51
Re: NOT NULL constraint failed - by DarkLored - 03.04.2016, 14:46
Re: NOT NULL constraint failed - by Biesmen - 03.04.2016, 16:12
Re: NOT NULL constraint failed - by DarkLored - 03.04.2016, 16:19

Forum Jump:


Users browsing this thread: 1 Guest(s)