vinegredz Posted March 26, 2019 Share Posted March 26, 2019 Здравствуйте! В общем-то вопрос, как вот сюда: \IPS\Db::i()->select( 'primary_id_field', 'cms_custom_database_2', array( 'field_9=?', $item) ) )->first(); Добавить оператор LIKE? Гуглил и смотрел документацию, но не нашел. Link to comment Share on other sites More sharing options...
newbie Posted March 26, 2019 Share Posted March 26, 2019 \IPS\Db::i()->select( 'primary_id_field', 'cms_custom_database_2', array( "field_9=? AND any_field LIKE CONCAT( '%', ?, '%' )", $item, 'search_phrase' ) )->first(); Link to comment Share on other sites More sharing options...
vinegredz Posted March 26, 2019 Author Share Posted March 26, 2019 Спасибо. Работает! Для тех кто будет после меня прикладываю вариант запроса с условием по одному полю: \IPS\Db::i()->select( 'primary_id_field', 'cms_custom_database_2', array( "field_9 LIKE CONCAT( '%', ?, '%' )", $item ) )->first(); Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now