From 850ab6999cb12520e1f00b39bf7803d6c47b3705 Mon Sep 17 00:00:00 2001 From: marc tobias Date: Tue, 26 Mar 2019 17:59:27 +0100 Subject: [PATCH] if nameaddress_vector was {} the database queries failed --- website/details.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/website/details.php b/website/details.php index b9818bbf..cb371e6b 100644 --- a/website/details.php +++ b/website/details.php @@ -220,11 +220,17 @@ if ($bIncludeKeywords) { $aPlaceSearchName = $oDB->getRow($sSQL); if (!empty($aPlaceSearchName)) { - $sSQL = 'SELECT * FROM word WHERE word_id in ('.substr($aPlaceSearchName['name_vector'], 1, -1).')'; - $aPlaceSearchNameKeywords = $oDB->getAll($sSQL); + $sWordIds = substr($aPlaceSearchName['name_vector'], 1, -1); + if (!empty($sWordIds)) { + $sSQL = 'SELECT * FROM word WHERE word_id in ('.$sWordIds.')'; + $aPlaceSearchNameKeywords = $oDB->getAll($sSQL); + } - $sSQL = 'SELECT * FROM word WHERE word_id in ('.substr($aPlaceSearchName['nameaddress_vector'], 1, -1).')'; - $aPlaceSearchAddressKeywords = $oDB->getAll($sSQL); + $sWordIds = substr($aPlaceSearchName['nameaddress_vector'], 1, -1); + if (!empty($sWordIds)) { + $sSQL = 'SELECT * FROM word WHERE word_id in ('.$sWordIds.')'; + $aPlaceSearchAddressKeywords = $oDB->getAll($sSQL); + } } }