Jump to content

Updating a float field


86Stang

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/98340-updating-a-float-field/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.