Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
vinegredz

Как добавить оператор LIKE в \IPS\Db::i()

Recommended Posts

Здравствуйте!

 

В общем-то вопрос, как вот сюда:

 

\IPS\Db::i()->select( 'primary_id_field', 'cms_custom_database_2', array( 'field_9=?', $item) ) )->first();

 

Добавить оператор LIKE? Гуглил и смотрел документацию, но не нашел.

Share this post


Link to post
\IPS\Db::i()->select( 'primary_id_field', 'cms_custom_database_2', array( "field_9=? AND any_field LIKE CONCAT( '%', ?, '%' )", $item, 'search_phrase' ) )->first();

Share this post


Link to post

Спасибо. Работает!

 

Для тех кто будет после меня прикладываю вариант запроса с условием по одному полю:

 

\IPS\Db::i()->select( 'primary_id_field', 'cms_custom_database_2', array( "field_9 LIKE CONCAT( '%', ?, '%' )", $item ) )->first();

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...