Php inserts null values into mysql.
The SQL statement is written as "insert into uer (id, name, pass) values ('', 'Lily', '123 ')"
Where, id is the primary key, auto-increment.
I remember setting it in the configuration file so that a null value can be passed during php execution, but I forgot where it was set. please let me know.
Reply to discussion (solution)
How do you set a null value for auto-increment? Sao Nian
"Insert into uer (name, pass) values ('Lily', '123 ')"
The inserted null values of id sub-growth must have an error.
Delete it, that is, insert into uer (name, pass) values ('Lee 4', '123 ')
Id auto-increment. it must be int type! How can I add strings?
The id does not need to be written.
Insert into uer (name, pass) values ('Lee 4', '123 ')
Yes. I have set this item before. now I forget which item in the configuration file. I have done this in the php100 video, but I didn't know where to set it.
I don't know what you're talking about.
Isn't your code?
Yes. I have set this item before. now I forget which item in the configuration file. I have done this in the php100 video, but I didn't know where to set it.
I have forgotten it.
Solve the problem. in the mysql configuration file, modify the settings where null values cannot be passed by default.
The default value is SQL-mode = "STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION ",
Change it to SQL-mode = "NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION"
Ah, I really cannot afford it. why do I have to change it? For this one, modify the configuration?
What can you do if you cannot change the single-hanging virtual space on the Internet,
Learning stage, various research