summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Individual.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/Individual.php b/app/Individual.php
index 458dd651d7..ecf5f753fb 100644
--- a/app/Individual.php
+++ b/app/Individual.php
@@ -46,19 +46,20 @@ class Individual extends GedcomRecord {
$args = array(
'tree_id' => $tree->getTreeId(),
);
+ $placeholders = array();
foreach (array_unique($xrefs) as $n => $xref) {
if (!isset(self::$gedcom_record_cache[$tree->getTreeId()][$xref])) {
- $sql .= ($n ? ',:x' : ':x') . $n;
+ $placeholders[] = ':x' . $n;
$args['x' . $n] = $xref;
}
}
- if (count($args) > 1) {
+ if (!empty($placeholders)) {
$rows = Database::prepare(
"SELECT i_id AS xref, i_gedcom AS gedcom" .
" FROM `##individuals`" .
- " WHERE i_file = :tree_id AND i_id IN (" . $sql . ")"
+ " WHERE i_file = :tree_id AND i_id IN (" . implode(',', $placeholders) . ")"
)->execute(
$args
)->fetchAll();