• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

PHP Filter a caracter in string in Gesior

Engradiel

Member
Joined
May 3, 2009
Messages
120
Reaction score
7
Location
Brazil
Hello guys. I am editing a guilds.php page that I can filter the guilds by name...

But I don't know how command use to filter guilds by name.

PHP:
$guilds_list = new DatabaseList('Guild');
$guilds_list->addOrder(new SQL_Order(new SQL_Field('name'), SQL_Order::ASC));

How command I use to filter a guild name only with "X" character like:

strpos($caracter, $string)

Like this:

PHP:
$guilds_list->setFilter(new SQL_Filter(new SQL_Field('name'), SQL_Filter::LIKE, "Test Name Guild"));

But not specific test name guild just test or name or guild and found for all guilds with this characters..
Post automatically merged:

Consegui:

$guilds_list->setFilter(new SQL_Filter(new SQL_Field('name'), SQL_Filter::LIKE, "%test%"));
 
Last edited:
Back
Top