From: Stéphane Jacob Date: Tue, 13 Jul 2010 20:49:11 +0000 (+0200) Subject: Fixes wrong id retrieval in geocoding. X-Git-Tag: xorg/1.0.1~15^2~40 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=505fb9bb167595b4f16a2693eec74456c7c441c4;p=platal.git Fixes wrong id retrieval in geocoding. Signed-off-by: Stéphane Jacob --- 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(); }