How to insert into database with setting the default values in phpmyadmin
18,266
Check your code is like this
when you creating database you should apply this option as well.
And in your code assign Your value3=NULL
.
Then add the above function as same.
INSERT INTO table_name (column1,column2,column3,...)
VALUES (value1,value2,value3,...);
Author by
Admin
Updated on June 04, 2022Comments
-
Admin almost 2 years
I have two
phpmyadmin
both are version4.2.7
andPHP
version is PHP Version 5.4.24 one of phpmyadmin is allowing null values and another not accepting the null valuesPhpmyadmin - 1
INSERT INTO table_name (column1,column2,column3,...) VALUES (value1,value2,value3,...);
Phpmyadmin - 2
On the second table i didn't give the values for column3 its error like
I got error:
General error: 1364 Field 'column3' doesn't have a default value
.Even though i didn't set the
null
forphpmyadmin-1
but its working fine. How can i solve this ? Any suggestion ?INSERT INTO table_name (column1,column2,...) VALUES (value1,value2,...);
-
Admin about 9 yearsyes i got it but i dont want to define for all fields how can i fix for the whole db ? and read my question please
-
Admin about 9 yearsI have given the same for
phpmyadmin -1
its working fine without assigning the null values -
Abdulla Nilam about 9 yearsINSERT INTO table_name SET column1 = 'value1', column2= 'value2'. try this out
-
Admin about 9 yearswithout nullable it was inserting in
phpmadmin-1
got it ? -
Admin about 9 yearsyour answer not helped :(