# Adding Boolean AND & OR to a PHP/MySQL search page

**URL:** https://boards.straightdope.com/t/adding-boolean-and-or-to-a-php-mysql-search-page/438116
**Category:** Factual Questions
**Created:** [February 18, 2008, 4:47pm UTC](https://boards.straightdope.com/t/adding-boolean-and-or-to-a-php-mysql-search-page/438116 "2008-02-18T16:47:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Rhythmdvl](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@Rhythmdvl](https://boards.straightdope.com/u/Rhythmdvl)
#### Post date: [February 18, 2008, 4:47pm UTC](https://boards.straightdope.com/t/adding-boolean-and-or-to-a-php-mysql-search-page/438116/1 "2008-02-18T16:47:08Z")

</div>

I have a PHP page that searches a MySQL database for three drop-down boxes and a keyword field (i.e., users can pull down region, theme, and scale, and enter words into a textbox before hitting submit).

Everything works nicely, but it defaults to a Boolean _AND_ when entering multiple keywords. I’d like to add basic _OR_ functionality, and if possible, the ability to accept quote marks and wildcards.

Is this a relatively straightforward change or something I’d be well enough leaving alone? I’m a hack, a build-it-as-I-need-it cobbler, so I have a mixed set of skills which is somewhat bothersome because it’s hard to tell when I’m getting in over my head.

Thanks!

Rhythm
