I am trying to insert something like
An error occurred when trying to add the field 'location_lat' via
ALTER TABLE `data` ADD `location_lat` FLOAT(3,7)
MySQL said: For float(M,D), double(M,D) or decimal(M,D),
M must be >= D (column 'location_lat').
Look at the error as it says MySQL said: For float(M,D) .. M must be >= D and with that your query should actually be
ALTER TABLE `data` ADD `location_lat` FLOAT(7,3)
Go through MySQL Documentation On Floating-Point Types
MySQL permits a nonstandard syntax: FLOAT(M,D). Here, (M,D) means than values can be stored with up to M digits in total, of which D digits may be after the decimal point.