PHP multi criteria search using checkboxes
<p>I am trying to make a site for my real estate business.
Until now i have managed to make correct queries using dropdown menus that select prices,sqm,bedrooms, etc</p>

<p>Now i am trying to make a multi-search criteria where a user can choose the kind of appartments 
to find..like studio,penthouse,single_floor appartment and etc via multi checkboxes.
In my database i have 8 columns that correspnd to the kinds of houses and each one of them can take a boolean value.
The columns are named OB_STUDIO,OB_PENTHOUSE,..... 
What i have done is create as many chkboxes as the categories are</p>

<pre><code>&lt;input type="checkbox" name="chk1" value="studio" /&gt;
&lt;input type="checkbox" name="chk2" value="penthouse" /&gt;
</code></pre>

<p>.
.
Then in my php code i wrote....</p>

<pre><code>if ($chk1 == 'studio') {
$where .= " and A.OB_STUDIO= true ";
}
if ($ch2 == 'penthouse') {
$where .= " and A.OB_PENTHOUSE= true ";
}
</code></pre>

<p>Then i pass the query string as a variable</p>

<pre><code>$request_string = "from " . G_DB_PREFIX . "OBJECTS A, 
" . G_DB_PREFIX . "OBJECT_TR B, 
" . G_DB_PREFIX . "TRANSLATION C
where A.OB_ID=B.OTR_OBJECTID and B.OTR_LANG='" . G_LANG . "'
and A.OB_PRODUCTID=C.TR_REFID and C.TR_LANG='" . G_LANG . "' and
C.TR_REFNAME='PRODUCTID' $where";
</code></pre>

<p>But instead of turning back all the houses that belong to those two categories (in case we check both) turns nothing. I understand that the reason is because the query as it is searches for products that belong to both categories.
What kind of expression do i have to use to achieve what i want? 
Probably i have to use a checkbox array for that?
The code works just fine if i only check one category.
I am really newbie to PHP so if you can give me a hand i will be grateful.
Thanx in advance</p>
