SaturdayNightSpecial Posted February 25, 2010 Share Posted February 25, 2010 Hello, I've tried multiple settings and done a bunch of searches but still can't get this figured out. I'm trying to insert latitude and longitude data into a mysql column set as a float 10,6 and it will not insert the data. The closest I've come to getting it to do anything is to show the data as 0.000000. I can't remember for sure but I think that was when the form was submitted without any entries in the latitude and longitude fields. I'm a novice using dreamweaver to build this site. I've tried changing the data "type" in the Dreamweaver "insert record" server behavior too but nothing has worked. If there is anything in the latitude and longitude fields then the entire "insert" fails. The data type is currently set to numeric. I tried putting the data in the latitude/longitude fields without the decimal point or a minus sign and the entire record did insert but the latitude and longitude both came in as 10000.000000. I wish I had more info to give you but that's all I can think of. Thanks in advance for the help. Quote Link to comment https://forums.phpfreaks.com/topic/193293-problem-inserting-latitude-longitude-data-into-float-column/ Share on other sites More sharing options...
fenway Posted February 25, 2010 Share Posted February 25, 2010 You don't want FLOAT, you want DECIMAL... which version? Quote Link to comment https://forums.phpfreaks.com/topic/193293-problem-inserting-latitude-longitude-data-into-float-column/#findComment-1018218 Share on other sites More sharing options...
SaturdayNightSpecial Posted February 25, 2010 Author Share Posted February 25, 2010 Hi Fenway, It's version 5.0.51a I started with FLOAT because that's what the documentation for GoogleMaps recommended but I've been working on it more and it seems to be a validation problem in the code. That field won't even insert the data if there's a decimal point in it. It will accept the minus sign though. I'm building the site with Dreamweaver using the WebAssist extensions and I tried adding a validation with it setting it to alphanumeric and allowing the optional character "." , the period and that didn't work either. I've tried DECIMAL, VARCHAR, TEXT and INTEGER and none of them will insert the period. At this point I'd just go with it if I could even get it to insert into a VARCHAR because I need to go live by March 1st and this will break the entire form submission if anyone tries to put the correct lat/long with a decimal in it. If they try it then the form just won't insert any data without displaying an error message. I've also tried changing the form field type with both numeric and text settings and neither of those has worked either. Shouldn't a VARCHAR accept any character though? Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/193293-problem-inserting-latitude-longitude-data-into-float-column/#findComment-1018236 Share on other sites More sharing options...
fenway Posted February 25, 2010 Share Posted February 25, 2010 VARCHAR will accept anything -- I don't believe it. Quote Link to comment https://forums.phpfreaks.com/topic/193293-problem-inserting-latitude-longitude-data-into-float-column/#findComment-1018263 Share on other sites More sharing options...
SaturdayNightSpecial Posted February 25, 2010 Author Share Posted February 25, 2010 That's what I thought. I'm going to go back and try it again. It wouldn't be the best situation but if I can get it to work that way I'll have to go with it. Quote Link to comment https://forums.phpfreaks.com/topic/193293-problem-inserting-latitude-longitude-data-into-float-column/#findComment-1018270 Share on other sites More sharing options...
fenway Posted February 26, 2010 Share Posted February 26, 2010 Well, still, DECIMAL is the correct choice -- as for validation, that's not mysql's fault. Quote Link to comment https://forums.phpfreaks.com/topic/193293-problem-inserting-latitude-longitude-data-into-float-column/#findComment-1018293 Share on other sites More sharing options...
SaturdayNightSpecial Posted February 26, 2010 Author Share Posted February 26, 2010 I agree, now that I've worked on it some more I don't think it's a MySql problem it seems to be a validation problem, something about the way the data is being sent to it. Quote Link to comment https://forums.phpfreaks.com/topic/193293-problem-inserting-latitude-longitude-data-into-float-column/#findComment-1018306 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.