public function safeInClause($arr, $args=array(), $dummy_value=-999999)
    {
        if (count($arr) == 0) { 
            $arr = array($dummy_value);
        }
        $args = array_merge($args, $arr);
        $inStr = str_repeat('?,', count($arr));
        $inStr = substr($inStr, 0, strlen($inStr)-1);

        return array($inStr, $args);
    }
public function safeInClause($arr, $args=array(), $dummy_value=-999999)
    {
        if (count($arr) == 0) { 
            $arr = array($dummy_value);
        }
        $args = array_merge($args, $arr);
        $inStr = str_repeat('?,', count($arr));
        $inStr = substr($inStr, 0, strlen($inStr)-1);

        return array($inStr, $args);
    }
public function safeInClause ( $ arr , $ args = array ( ) , $ dummy_value = - 999999 ) { if ( count ( $ arr ) == 0 ) { $ arr = array ( $ dummy_value ) ; } $ args = array_merge ( $ args , $ arr ) ; $ inStr = str_repeat ( '?,' , count ( $ arr ) ) ; $ inStr = substr ( $ inStr , 0 , strlen ( $ inStr ) - 1 ) ; return array ( $ inStr , $ args ) ; }
Build an SQL IN clause from an array
@param $arr [array] of values
@param $args [array, optional] existing query parameter list
@param $dummy_value [optional] plug value when the array of values is empty
@return [tuple] SQL string of placeholders, array of query parameters
Build an SQL IN clause from an array