From: Kaj-Michael Lang Date: Mon, 5 Nov 2007 09:36:30 +0000 (+0200) Subject: Look in postal_code when searching with a string X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25299a08fc7cf9b8955c8a6bab1bebf6aa036fbe;p=mapper Look in postal_code when searching with a string --- diff --git a/src/poi.c b/src/poi.c index d4fdef1..8b1ce81 100644 --- a/src/poi.c +++ b/src/poi.c @@ -251,7 +251,7 @@ poi_db_prepare(sqlite3 *db) " from poi p, category c " " where p.lat between ? and ? " " and p.lon between ? and ? " - " and c.enabled=1 and p.cat_id = c.cat_id and p.label like ? order by p.label, c.label", + " and c.enabled=1 and p.cat_id = c.cat_id and (p.label like $NAME or p.postal_code like $NAME) order by p.label, c.label", -1, &poisql.select_poi_search, NULL)!=SQLITE_OK) return FALSE; @@ -262,7 +262,7 @@ poi_db_prepare(sqlite3 *db) " from poi p, category c " " where p.lat between ? and ? " " and p.lon between ? and ? " - " and c.enabled=1 and p.cat_id = c.cat_id and p.label like ? and c.cat_id = ? order by p.label", + " and c.enabled=1 and p.cat_id = c.cat_id and (p.label like $NAME or p.postal_code like $NAME) and c.cat_id = ? order by p.label", -1, &poisql.select_poi_search_cat, NULL)!=SQLITE_OK) return FALSE;