This is my database (just for example):
+----------------+---------------+------+-----+---------+---------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------------+------+-----+---------+---------------+
| id | integer | NO |PK | NONE |AUTO_INCREMENT |
| name | string | NO | | NONE | |
| email | string | YES | | NULL | |
| phoneNumber | string | YES | | NULL | |
| password | string | NO | | NONE | |
| maxDistance | integer | NO | | NONE | |
| showMeOnApp | integer | NO | | NONE | |
| created_at | datetime | NO | | NONE | |
| updated_at | datetime | NO | | NONE | |
+----------------+---------------+------+-----+---------+---------------+
So the problem here is that when I make an insert on phpMyAdmin without adding any value on password
or on created_at
for example, fields that should have a value, it still insert the row even if I don't set a value. Why this? I think this should give me an error saying something like: Password can't be null, maxDistance can't be null...
you know? Something like that, what I'm getting now is this:
1 row inserted
Warning: #1366 Incorrect integer value: '' for column `databasename`.`users`.`maxDistance` at row 1
Warning: #1366 Incorrect integer value: '' for column `databasename`.`users`.`showMeOnApp` at row 1
Warning: # 1265 Truncated data for column 'created_at' in row 1
Warning: # 1265 Truncated data for column 'updated_at' in row 1
But insert anyway.
So this is my question, why it still insert the row if I don't satisfy all the conditions?