stuckwithcode Posted October 7, 2010 Share Posted October 7, 2010 Hello, I have a mysql table and when I populate it through php i have to insert blank values into fields if not it will not work. How can I put the default value in phpmyadmin to be blank, but not null. I dont understand the null checkbox or the default value option. Please help not phpmyadmin guides found Quote Link to comment Share on other sites More sharing options...
anups Posted October 7, 2010 Share Posted October 7, 2010 it will be good if you alter table to allow null values ALTER TABLE `test` CHANGE `field` `field` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL Quote Link to comment Share on other sites More sharing options...
kickstart Posted October 7, 2010 Share Posted October 7, 2010 Hi The null check box is to set the column to allow or not allow null values. What do you mean by accepting blanks but not nulls? Do you mean a space? Or do you mean nothing (which is pretty much what null is, accepting issues with padding out with spaces). All the best Keith Quote Link to comment Share on other sites More sharing options...
stuckwithcode Posted October 7, 2010 Author Share Posted October 7, 2010 when I insert my value i insert $empty = "" and insert that Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted October 7, 2010 Share Posted October 7, 2010 without seeing your SQL, my guess is that you are not putting single-quotes around the values you are inserting. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.