I want to check if any user in my Database has in categorie\_bit a value of 0 or 1 and check this before my foreach.

I got this in my php script:

```
foreach ($database->query('SELECT id,firstname,lastname FROM `staff` WHERE categorie_bit = 1') as $resultRandom) {
    var_dump($resultRandom);
}

```

Pseudocode( I want something like this):

```
if(categorie_bit = 1) {
    foreach ($database->query('SELECT id,firstname,lastname FROM `staff` WHERE categorie_bit = 1') as $resultRandom) {
        var_dump($resultRandom);
    }
} else {
      echo "0";
}

```