From 505fb9bb167595b4f16a2693eec74456c7c441c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 13 Jul 2010 22:49:11 +0200 Subject: [PATCH] Fixes wrong id retrieval in geocoding. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- include/geocoding.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/geocoding.inc.php b/include/geocoding.inc.php index 845a314..a828366 100644 --- a/include/geocoding.inc.php +++ b/include/geocoding.inc.php @@ -47,9 +47,10 @@ abstract class Geocoder { WHERE name = {?}", $address[$area . 'Name']); if ($res->numRows() == 0) { - $address[$area . 'Id'] = XDB::execute("INSERT INTO " . $databases[$area] . " (name, country) - VALUES ({?}, {?})", - $address[$area . 'Name'], $address['countryId']); + XDB::execute('INSERT INTO ' . $databases[$area] . ' (name, country) + VALUES ({?}, {?})', + $address[$area . 'Name'], $address['countryId']); + $address[$area . 'Id'] = XDB::insertId(); } else { $address[$area . 'Id'] = $res->fetchOneCell(); } -- 2.1.4