MyBB Community Forums

Full Version: SQL Error on Search
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
Recently I converted from phpbb3 to mybb 1.6.2, everything went smooth, and now almost everything up and running fine.

But I am having small problem, I am using SimBlue theme from following link.
http://shopmybb.com/item/simblue/18

And if i made any search from top search box, i am getting error,
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    1054 - Unknown column 'Array' in 'where clause'
Query:
    SELECT pid, tid FROM mybb_posts WHERE pid IN(Array) AND visible >= 0 ORDER BY dateline DESC 

I found this topic having same error, but the fix provided there not same like the theme I am using.
http://community.mybb.com/thread-90384.html

Hence I am posting my top search template code here
<form action="./search.php" method="post">
                <input type="hidden" value="do_search" name="action"/>
		<input type="submit" value="" class="go" />
		<input type="text" value="Search..." onfocus="if(this.value == 'Search...') { this.value=''; }" onblur="if(this.value == '') { this.value='Search...'; }" class="searchbox" name="keywords" />
</form> 

Any help will be appreciated.

Thanks
JusTy



Not sure how this is related to the Merge System, but try searching on just the default MyBB theme.
This has nothing to do with the merge, its your theme that has the code wrong.

Moved to theme support

Change this:

<form action="./search.php" method="post">
                <input type="hidden" value="do_search" name="action"/>
        <input type="submit" value="" class="go" />
        <input type="text" value="Search..." onfocus="if(this.value == 'Search...') { this.value=''; }" onblur="if(this.value == '') { this.value='Search...'; }" class="searchbox" name="keywords" />
</form>

To:

<form action="./search.php" method="post">
                <input type="hidden" value="do_search" name="action"/>
                <input type="hidden" name="postthread" value="1" />
                <input type="hidden" name="forums" value="all" />
                <input type="hidden" name="showresults" value="threads" />
        <input type="submit" value="" class="go" />
        <input type="text" value="Search..." onfocus="if(this.value == 'Search...') { this.value=''; }" onblur="if(this.value == '') { this.value='Search...'; }" class="searchbox" name="keywords" />
</form>

You can change the forums and showresults to search specific forums only or to display posts as results instead of threads.
Thanks for the code, now it's working fine..