MyBB Community Forums

Full Version: Search custom profile field in memberlist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been trying to customise the website search field at the base of my memberlist to instead search for a custom profile field.

[Image: 31f846aca26e430baaafd8fe920e4e83.png]

I have been following instructions on how to do so from this rather old thread:

but as a result and carefully following and repeating the instructions I receive an SQL error which I thought may have been the problem with using a tutorial made for an older version of the software.

My sql error: 

[Image: 5b407530716349fdae17347e68c1b623.png]

I'm wondering if there's an updated way for me to be able to search for a custom profile field in the memberlist quick search.

Thanks in advance for any help.
you can try removing editable=1 AND from the data used for $query [step 2]
$query = $db->simple_select("profilefields", "*", "type!='checkbox' AND type!='multiselect' AND type!='textarea' AND hidden=0", array('order_by' => 'disporder'));
Thank you, 

the solution was to amend the code to:
$query = $db->simple_select("profilefields", "*", "type!='checkbox' AND type!='multiselect' AND type!='textarea'", array('order_by' => 'disporder'));
^ oh! yes, hidden field also doesn't exist in the table of profilefields in MyBB 1.8.x - somehow missed that!