dflow Posted December 16, 2011 Share Posted December 16, 2011 im trying to update a GPS table for example: UPDATE markers SET lat = '38.40907441955112' AND lng = '14.943452775478363' WHERE ApID = '35911' i tried with float 20,18 it isnt updatng correctly :confused: Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/ Share on other sites More sharing options...
xyph Posted December 16, 2011 Share Posted December 16, 2011 The AND clause shouldn't be there. You should check out the error function of whatever database flavor you're using. In MySQL, it's mysql_error. That will contain an error message, if any should occur. Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/#findComment-1298390 Share on other sites More sharing options...
dflow Posted December 16, 2011 Author Share Posted December 16, 2011 The AND clause shouldn't be there. You should check out the error function of whatever database flavor you're using. In MySQL, it's mysql_error. That will contain an error message, if any should occur. thanks my bad Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/#findComment-1298486 Share on other sites More sharing options...
dflow Posted December 16, 2011 Author Share Posted December 16, 2011 The AND clause shouldn't be there. You should check out the error function of whatever database flavor you're using. In MySQL, it's mysql_error. That will contain an error message, if any should occur. thanks my bad well i jumped the gun (classic ADD) UPDATE markers SET lat = '38.53869991333522', lng = '-0.120849609375' WHERE ApID = '33236' is returning 0 affected rows in phpmyadmin mysql_error() gives nothing Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/#findComment-1298493 Share on other sites More sharing options...
xyph Posted December 16, 2011 Share Posted December 16, 2011 My guess is there isn't a row where `ApID` = '33236' Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/#findComment-1298635 Share on other sites More sharing options...
dflow Posted December 17, 2011 Author Share Posted December 17, 2011 My guess is there isn't a row where `ApID` = '33236' no it does exist strange Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/#findComment-1298780 Share on other sites More sharing options...
xyph Posted December 19, 2011 Share Posted December 19, 2011 It won't update the row if it doesn't need to. Change one of the values, and it will update. Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/#findComment-1299107 Share on other sites More sharing options...
dflow Posted December 28, 2011 Author Share Posted December 28, 2011 It won't update the row if it doesn't need to. Change one of the values, and it will update. these are new values Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/#findComment-1301834 Share on other sites More sharing options...
Pikachu2000 Posted December 28, 2011 Share Posted December 28, 2011 Real simple test: does "SELECT * WHERE ApID = '33236'" return any results? Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/#findComment-1301911 Share on other sites More sharing options...
dflow Posted December 29, 2011 Author Share Posted December 29, 2011 Real simple test: does "SELECT * WHERE ApID = '33236'" return any results? yes i have an old record there ??? Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/#findComment-1302125 Share on other sites More sharing options...
Pikachu2000 Posted December 30, 2011 Share Posted December 30, 2011 If you actually ran the select query and it produced results, then I don't see any reason for the UPDATE query to fail. Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/#findComment-1302641 Share on other sites More sharing options...
dflow Posted January 1, 2012 Author Share Posted January 1, 2012 If you actually ran the select query and it produced results, then I don't see any reason for the UPDATE query to fail. yep i dont get it myself, i have 0 affected rows ... i thought it's something to do with the float structure. Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/#findComment-1303025 Share on other sites More sharing options...
Pikachu2000 Posted January 1, 2012 Share Posted January 1, 2012 One last thought. Make sure the fields for latitude and longitude are set as UNSIGNED. Quote Link to comment https://forums.phpfreaks.com/topic/253275-gps-coordinates-and-float-issue-lengthvalue/#findComment-1303073 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.