diff --git a/phpBB/search.php b/phpBB/search.php
index 965c1a3c4b..2defd4bb92 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -395,7 +395,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
 
 			while ($row = $db->sql_fetchrow($result))
 			{
-				$id_ary[] = $row[$field];
+				$id_ary[] = (int) $row[$field];
 			}
 			$db->sql_freeresult($result);