I've a table named 'Places' to save information about places
+------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | place_name | varchar(120) | NO | | NULL | | | latitude | float(10,6) | NO | | NULL | | | longitude | float(10,6) | NO | | NULL | | +------------------+--------------+------+-----+---------+----------------+
Now when i try to insert values in to the table via a Model in cakephp, say like
[Place] => Array ( [place_name] => St Francis De Sales [latitude] => 42.381486 [longitude] => -71.066718 )
The query being executed from cakephp rounds off the value to 4 fractions and I dont want that to happen..
INSERT INTO `places` (`place_name`, `latitude`, `longitude`) VALUES ('St Francis De Sales', 42.3815, -71.0667)
When i check the table, the latitude and longitude values are rounded off or changed..
+-------------------------------+-----------+------------+ | place_name | latitude | longitude | +-------------------------------+-----------+------------+ | Saint Francis De Sales Church | 42.379501 | -71.062798 | +-------------------------------+-----------+------------+
I have no problem in inserting values directly from mysql console. So, i guess this is an issue related with cakephp. How can i solve this...??
places
(place_name
,latitude
,longitude
) VALUES ('St Francis De Sales', 42.3815, -71.0667) It already rounds off the value there before inserting in to the table. – dinkandebug($this->data); exit;
before$this->Model->save()
occurs; is all the data present as it should be? – Ross