Welcome Guest, Not a member yet? Register   Sign In
Can CI accept a variable as the full join syntax? [SOLVED]
#2

PHP Code:
$joinData = [
            0 => [
                'table' => 'table AS k',
                'condition' => 'k.something = j.anotherthing',
                'type' => 'left',
            ],
            1 => [
                'table' => 'table AS t',
                'condition' => 't.something = j.anotherthing',
                'type' => 'left',
            ],
        ];

        if (!empty($joinData)) {
            foreach($joinData as $key => $join){
                $builder->join($join['table'], $join['condition'], $join['type']);
            }
        
Reply


Messages In This Thread
RE: Can CI accept a variable as the full join syntax? - by davis.lasis - 07-30-2021, 03:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB