summaryrefslogtreecommitdiff
path: root/autocomplete.php
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2012-07-08 07:49:02 +0000
committerfisharebest <fisharebest@gmail.com>2012-07-08 07:49:02 +0000
commitacbaaf3cf07f3882988144179e03161411054d6e (patch)
tree06ca3998847287641b01763596e05acec3164405 /autocomplete.php
parent9cf004719dd263fb0e09c96737bdbd9676368463 (diff)
downloadwebtrees-acbaaf3cf07f3882988144179e03161411054d6e.tar.gz
webtrees-acbaaf3cf07f3882988144179e03161411054d6e.tar.bz2
webtrees-acbaaf3cf07f3882988144179e03161411054d6e.zip
Make more use of new WT_Place class. Update indexes for wt_place table.
Diffstat (limited to 'autocomplete.php')
-rw-r--r--autocomplete.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/autocomplete.php b/autocomplete.php
index 36ffe84c7d..ea178717d3 100644
--- a/autocomplete.php
+++ b/autocomplete.php
@@ -40,9 +40,9 @@ case 'ASSO': // Associates of an individuals, whose name contains the search ter
"SELECT 'INDI' AS type, i_id AS xref, i_file AS ged_id, i_gedcom AS gedrec, n_full".
" FROM `##individuals`".
" JOIN `##name` ON (i_id=n_id AND i_file=n_file)".
- " WHERE n_full LIKE CONCAT('%', REPLACE(?, ' ', '%'), '%') AND i_file=? ORDER BY n_full"
+ " WHERE (n_full LIKE CONCAT('%', REPLACE(?, ' ', '%'), '%') OR n_surn LIKE CONCAT('%', REPLACE(?, ' ', '%'), '%')) AND i_file=? ORDER BY n_full"
)
- ->execute(array($term, WT_GED_ID))
+ ->execute(array($term, $term, WT_GED_ID))
->fetchAll(PDO::FETCH_ASSOC);
// Filter for privacy - and whether they could be alive at the right time
$pid=safe_GET_xref('pid');
@@ -187,9 +187,9 @@ case 'INDI': // Individuals, whose name contains the search terms
"SELECT 'INDI' AS type, i_id AS xref, i_file AS ged_id, i_gedcom AS gedrec, n_full".
" FROM `##individuals`".
" JOIN `##name` ON (i_id=n_id AND i_file=n_file)".
- " WHERE n_full LIKE CONCAT('%', REPLACE(?, ' ', '%'), '%') AND i_file=? ORDER BY n_full"
+ " WHERE (n_full LIKE CONCAT('%', REPLACE(?, ' ', '%'), '%') OR n_surn LIKE CONCAT('%', REPLACE(?, ' ', '%'), '%')) AND i_file=? ORDER BY n_full"
)
- ->execute(array($term, WT_GED_ID))
+ ->execute(array($term, $term, WT_GED_ID))
->fetchAll(PDO::FETCH_ASSOC);
// Filter for privacy
foreach ($rows as $row) {