I've used a database in the past to do a distance calculator using longitude and latitude from a mysql 4.x database. All was well when I used the following to create the table:

CREATE TABLE `zipcodes` (
  `id` bigint(13) NOT NULL auto_increment,
  `zipcode` bigint(7) NOT NULL default '0',
  `city` varchar(50) NOT NULL default '',
  `state` char(2) NOT NULL default '',
  `lat` decimal(8,7) NOT NULL default '0.0000000',
  `longitude` float(8,7) NOT NULL default '0.0000000',
  `timezone` char(3) NOT NULL default '',
  `daylight` tinyint(1) NOT NULL default '0',
);

However, when I use the same query on a mysql 5 database and insert data the longitude and latitude get changed to -99.999999. I'm not really up on the changes from mysql 4 to 5 so could someone clue me in as to what I need to change, or at least point me to a resource?

Thanks

    I don't know how your values look nor the exact MySQL's version like but you could take a look here and here

      Write a Reply...