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 Link to comment https://forums.phpfreaks.com/topic/215321-php-help-stuck/ 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 Link to comment https://forums.phpfreaks.com/topic/215321-php-help-stuck/#findComment-1119719 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 Link to comment https://forums.phpfreaks.com/topic/215321-php-help-stuck/#findComment-1119722 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 Link to comment https://forums.phpfreaks.com/topic/215321-php-help-stuck/#findComment-1119729 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. Link to comment https://forums.phpfreaks.com/topic/215321-php-help-stuck/#findComment-1119779 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.