I found a problem when inserting data into a database using PHP, and when inserting a value with a field type of varchar, the database is considered to be 0 by default, regardless of the number of 0 inserted. Ask the great God. Why What to do with this situation.
Reply to discussion (solution)
On the SQL statement
Table Results
INSERT into User (Phonenumber,password) VALUES (12312312312,000000)
INSERT into User (Phonenumber,password) VALUES (' 12312312312 ', ' 000000 ')
Please add the single quotation mark, thank you
You try to add 0 quotation marks.
Character type, single quote in SQL statement
The string needs to be surrounded by quotation marks, otherwise it will be converted to a number, 00000 to a number is 0, so the database is saved is 0.
VarChar is a character type
When you insert data, the string variable needs to be quoted.