public static function havingComplete($array){
        $c = 0;
        $r = "";
        if( is_array( $array ) )
            foreach($array as $k => $v){
                if($c) $r .= " AND ";

                if (strpos($v, ":") !== false){ // number range [0] e [1]
                    $vArray = explode(":",$v);
                    if($vArray[0] <= $vArray[1])
                        $r .="(" .$k ." BETWEEN ".$vArray[0]." AND ".$vArray[1].")";
                }else{
                    if (strpos($v, ">") !== false){ // number [0] bigger than [1]
                        $v = str_replace(">", "", $v);
                        $r .= $k ." >".$v."";
                    }else if (strpos($v, "<") !== false){ // number [1] bigger than [0]
                        $v = str_replace("<", "", $v);
                        $r .= $k ." <".$v."";
                    }else{ // number only
                        $r .= $k ." = ".$v."";
                    }
                }

                $c++;
            }
        return empty($r) ? "1=1" : $r;
    }
public static function havingComplete($array){
        $c = 0;
        $r = "";
        if( is_array( $array ) )
            foreach($array as $k => $v){
                if($c) $r .= " AND ";

                if (strpos($v, ":") !== false){ // number range [0] e [1]
                    $vArray = explode(":",$v);
                    if($vArray[0] <= $vArray[1])
                        $r .="(" .$k ." BETWEEN ".$vArray[0]." AND ".$vArray[1].")";
                }else{
                    if (strpos($v, ">") !== false){ // number [0] bigger than [1]
                        $v = str_replace(">", "", $v);
                        $r .= $k ." >".$v."";
                    }else if (strpos($v, "<") !== false){ // number [1] bigger than [0]
                        $v = str_replace("<", "", $v);
                        $r .= $k ." <".$v."";
                    }else{ // number only
                        $r .= $k ." = ".$v."";
                    }
                }

                $c++;
            }
        return empty($r) ? "1=1" : $r;
    }
public static function havingComplete ( $ array ) { $ c = 0 ; $ r = "" ; if ( is_array ( $ array ) ) foreach ( $ array as $ k => $ v ) { if ( $ c ) $ r .= " AND " ; if ( strpos ( $ v , ":" ) !== false ) { // number range [0] e [1] $ vArray = explode ( ":" , $ v ) ; if ( $ vArray [ 0 ] <= $ vArray [ 1 ] ) $ r .= "(" . $ k . " BETWEEN " . $ vArray [ 0 ] . " AND " . $ vArray [ 1 ] . ")" ; } else { if ( strpos ( $ v , ">" ) !== false ) { // number [0] bigger than [1] $ v = str_replace ( ">" , "" , $ v ) ; $ r .= $ k . " >" . $ v . "" ; } else if ( strpos ( $ v , "<" ) !== false ) { // number [1] bigger than [0] $ v = str_replace ( "<" , "" , $ v ) ; $ r .= $ k . " <" . $ v . "" ; } else { // number only $ r .= $ k . " = " . $ v . "" ; } } $ c ++ ; } return empty ( $ r ) ? "1=1" : $ r ; }
not in use, needs improves and tests
not in use needs improves and tests