doctrine

Error in Geographical Template - input is out of range - Doctrine / Symfony

If you are using the getDistance method provided by Geogrphical Template in Doctrine and got this error:


500 | Internal Server Error | Doctrine_Connection_Pgsql_Exception
SQLSTATE[22003]: Numeric value out of range: 7 ERROR: input is out of range

You probably have the same problem that I got today..

How to get the lastinsertid Doctrine

This example show how you can get the latest insert id on table continent.


$dbh = Doctrine_Manager::getInstance()->getCurrentConnection();
$sth = $dbh->prepare("INSERT INTO continent (created_at, updated_at) VALUES ( NOW(), NOW() )");
$sth->execute();

$conn = Doctrine_Manager::getInstance()->getCurrentConnection();
$conn->lastInsertId('continent_id');

Syndicate content