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

(This post was last modified: 08-01-2021, 01:35 AM by InsiteFX.)

I created a model which supports a generic database GET request and if you include data from the $joinArray then it will loop through the values of this array and create $builder->join($joinArray);

Unfortunately I can't get this to work.

To keep it short I would like to do the following:
Code:
    $joinData = array(
        0 => "'table AS k', 'k.something = j.anotherthing', 'left'"
    );

    if(isset($joinData)){
        foreach($joinData as $key => $value){
            $builder->join($value);
        }
    }

In the end, it should behave like this:
     $builder->join('table AS k', 'k.something = j.anotherthing', 'left');

thank you for your time!

Answered, look below for the code if you're having the same issue as me
Reply


Messages In This Thread
Can CI accept a variable as the full join syntax? [SOLVED] - by eri146 - 07-29-2021, 10:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB