# \[MySQL\] Simple, but I don't know

**URL:** <https://forum.kirupa.com/t/mysql-simple-but-i-dont-know/168111>\
**Category:** programming\
**Created:** [November 4, 2005, 1:16am UTC](https://forum.kirupa.com/t/mysql-simple-but-i-dont-know/168111 "2005-11-04T01:16:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maniaci](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@Maniaci](https://forum.kirupa.com/u/Maniaci)\
**Post date:** [November 4, 2005, 1:16am UTC](https://forum.kirupa.com/t/mysql-simple-but-i-dont-know/168111/1 "2005-11-04T01:16:13Z")

</div>

I have a field that can be “1”, “2”, “3” or any of the three separated by a space. i.e. “1 2” or maybe “1 2 3” etc. Also, the numbers are not depended of eachother: “2 3” is possible.

I want to put all entries with a 1 (either “1” or “1 2 3” etc…) to be put into one variable, and the same with both 2, and 3. What is the SQL I should use?

```php

$sql = "SELECT * FROM mytable WHERE myfield='1'";

```

This is simple enough when there is only a “1” in the field, but how can I know if the field contains a 1 even when there are other values within it.

Thanks.
