core/classes/PDO.class.php
private function setQuestionMarkPlaceHolders($q, $args){

        foreach($args as $k=>$a){
            if(is_array($a) && isset($a['raw'])){
                $args[$k] = $a['raw'];
            }//if
            else {
                $args[$k] = $this->prepareType($a);
            }//el
        }//foreach


        $positions = Array();
        $p = -1;
        while(($p = strpos($q, '?', $p + 1)) !== false){
            $positions[] = $p;
        }//while

        if(count($args) != count($positions)){
            throw new \Disco\exceptions\DBQuery('Number of passed arguements does not match the number of `?` placeholders');
        }//if


        //reverse em so when we do replacements we dont have 
        //to keep track of the change in length to positions
        $args = array_reverse($args);
        $positions = array_reverse($positions);

        foreach($positions as $k=>$pos){
            $q = substr_replace($q,$args[$k],$pos,1);
        }//foreach

        return $q;
       
    }
private function setQuestionMarkPlaceHolders($q, $args){

        foreach($args as $k=>$a){
            if(is_array($a) && isset($a['raw'])){
                $args[$k] = $a['raw'];
            }//if
            else {
                $args[$k] = $this->prepareType($a);
            }//el
        }//foreach


        $positions = Array();
        $p = -1;
        while(($p = strpos($q, '?', $p + 1)) !== false){
            $positions[] = $p;
        }//while

        if(count($args) != count($positions)){
            throw new \Disco\exceptions\DBQuery('Number of passed arguements does not match the number of `?` placeholders');
        }//if


        //reverse em so when we do replacements we dont have 
        //to keep track of the change in length to positions
        $args = array_reverse($args);
        $positions = array_reverse($positions);

        foreach($positions as $k=>$pos){
            $q = substr_replace($q,$args[$k],$pos,1);
        }//foreach

        return $q;
       
    }
private function setQuestionMarkPlaceHolders ( $ q , $ args ) { foreach ( $ args as $ k => $ a ) { if ( is_array ( $ a ) && isset ( $ a [ 'raw' ] ) ) { $ args [ $ k ] = $ a [ 'raw' ] ; } //if else { $ args [ $ k ] = $ this -> prepareType ( $ a ) ; } //el } //foreach $ positions = Array ( ) ; $ p = - 1 ; while ( ( $ p = strpos ( $ q , '?' , $ p + 1 ) ) !== false ) { $ positions [ ] = $ p ; } //while if ( count ( $ args ) != count ( $ positions ) ) { throw new \ Disco \ exceptions \ DBQuery ( 'Number of passed arguements does not match the number of `?` placeholders' ) ; } //if //reverse em so when we do replacements we dont have  //to keep track of the change in length to positions $ args = array_reverse ( $ args ) ; $ positions = array_reverse ( $ positions ) ; foreach ( $ positions as $ k => $ pos ) { $ q = substr_replace ( $ q , $ args [ $ k ] , $ pos , 1 ) ; } //foreach return $ q ; }
Set `?` mark value placeholders with the values passed in args in the order they are set in the query and
the args.

@param string        $q      The query string.
@param string|array  $args   The variables to bind to the $q.

@return string               The $q with $args bound into it.

@throws \Disco\exceptions\DBQuery When the number of arguements doesn't match the numebr of `?`
placeholders.
Set ? mark value placeholders with the values passed in args in the order they are set in the query and the args .