By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 834 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

Mysql - DEFAULT '' defined yet NULL inserted

P: n/a

Greetings,

My database was inserting NULL for empty strings so I changed the field
definition with this query:

ALTER TABLE `myTable` CHANGE `myUrl` `myUrl` VARCHAR( 255 ) NOT NULL
DEFAULT ''

No error was reported following the query and yet I still get NULLs on
insertions.
Any ideas?

Jun 26 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Try doing a "DESCRIBE myTable;" and see what it gives you for the
"myUrl" field.
zorro wrote:
Greetings,

My database was inserting NULL for empty strings so I changed the field
definition with this query:

ALTER TABLE `myTable` CHANGE `myUrl` `myUrl` VARCHAR( 255 ) NOT NULL
DEFAULT ''

No error was reported following the query and yet I still get NULLs on
insertions.
Any ideas?


Jun 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.