Need opinions on variable query build up
<p>I'm trying to build up some functions to variably build up queries from arrays. And i need to know whether i'm actually doing it correctly. Right now i'm wondering if this function to build a variable "WHERE" is okay, or should be improved.</p>

<p>Any opinions / tips are appreciated.</p>

<pre><code>private function buildWhereFromArray($var, $array, $count)
    {
        $where = '(';
        for($i = 0; $i &lt;= ($count - 1); $i++)
        {
            if(!is_numeric($array[$i]))
            {
                return false;
            }
            $where .= '('.$var.' = '.$array[$i].')';
            if($i != ($typeCount - 1))
            {
                $where .= ' AND ';
            }
        }
        $where .= ')';
        return $where;
    }
</code></pre>

<p>The variables should be obvious.</p>
