Hm, ok. Well I think this error is related to Erwin's "Search Thread" hack, and here's the query that I have in my search.php.
$getnum=$DB_site->query_first("SELECT COUNT(*) AS posts FROM post
".
iif(strlen(strpos($search[query],"thread."))," LEFT JOIN thread ON thread.threadid=post.threadid ","").
" WHERE post.visible=1 AND $newpostsql $searchthreadquery $search[query]");
Is that what it should be or no? I'm guessing no.

But I did follow the instructions correctly.