I created a table Place in mysql. In this table there are three fields.
1. Place_Name varchar(20)
2. latitude decimal(15,12)
3. longitude decimal(15,12)
There is a problem occurred when user inserted value like as 55636.1232 in latitude or in longitude.
Because this value is above the range of capacity of these fields. Because i allowed 3
digit before decimal point while user is trying to enter more than 3 digit before decimal
points. In this case 999.999999999999 value is inserted but i want to insert my default
value if user do such type of mistake.
I want that when user do this type of mistake then my default value should be entered in that record.
Please help me what should i do to solve such type of problem. I am waiting for your suggestions.
Thank you in advance.
You should set SQL Mode to strict_all_tables by executing
This will prevent from entering invalid data and on violation will throw this MySQL error: