# MYSQL query

**URL:** <https://forum.kirupa.com/t/mysql-query/290174>\
**Category:** programming\
**Created:** [June 10, 2009, 8:39pm UTC](https://forum.kirupa.com/t/mysql-query/290174 "2009-06-10T20:39:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimjiminyjimjim](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jimjiminyjimjim](https://forum.kirupa.com/u/jimjiminyjimjim)\
**Post date:** [June 10, 2009, 8:39pm UTC](https://forum.kirupa.com/t/mysql-query/290174/1 "2009-06-10T20:39:24Z")

</div>

I would like to match two words in a query but the two word might switch order e.g

“SELECT \* FROM products WHERE class LIKE '%”.$search."%’ ORDER BY class, sliderpos ";

“product” might be for example silver trays

but search might be “trays silver”

Whats the correct query as I don’t think my current one is always matching.

Much appreciated.
