# MySQL Query problem

**URL:** https://forum.kirupa.com/t/mysql-query-problem/220445
**Category:** programming
**Created:** [March 26, 2007, 2:18pm UTC](https://forum.kirupa.com/t/mysql-query-problem/220445 "2007-03-26T14:18:52Z")
**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: [March 26, 2007, 2:18pm UTC](https://forum.kirupa.com/t/mysql-query-problem/220445/1 "2007-03-26T14:18:52Z")

</div>

At the moment I am using a query like this:

```php

$query = "SELECT * FROM buynowmodel
			WHERE modelname LIKE '%".$search."%' || make LIKE '%".$search."%' ORDER BY make";

```

If the search variable is something like Audi then all Audis are found fine. If the search term is A4 then all Audi A4s are found fine. Problem is if a user types in Audi A4 as a search term then nothing is found because neither the make or the model is like Audi A4.

Is there a way for MySql to take the two separate words as search terms or just take the second word (as the make isn’t actually needed).

Thanks very much.
