86Stang Posted March 28, 2008 Share Posted March 28, 2008 I've got a field with float(10,6) as the type to accommodate coordinates (latitudes & longitudes). I'm running the below to try and update it: $qry = "UPDATE table SET address='$address', phone='$phone', lat='$lat', $lng='$lng' WHERE id = $id"; mysql_query($qry) or die ("Error during query!" . mysql_error()); but it's kicking this back at me: Error during query!You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0.000000='0.000000' WHERE id = 20' at line 1 Any ideas? Can you not update floats like other field types? Quote Link to comment Share on other sites More sharing options...
JD* Posted March 28, 2008 Share Posted March 28, 2008 $qry = "UPDATE table SET address='$address', phone='$phone', lat='$lat', $lng='$lng' WHERE id = $id"; Reason it's messed up is because you have $lng=$lng. Change it to lng=$lng Quote Link to comment Share on other sites More sharing options...
86Stang Posted March 28, 2008 Author Share Posted March 28, 2008 Doh! Ha!!! Excuse me while I beat the stupidity out of myself! Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 28, 2008 Share Posted March 28, 2008 Doh! Ha!!! Excuse me while I beat the stupidity out of myself! read your mysql error next time and you should realize that the 0.00000=0.00000 part is the issue and then say I don't have a field name 0.00000 and you solved your own problem Quote Link to comment 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.