retrieving data from a database and re-retrieving from another database |
how to i make the following request correctly and optimized?
PHP Code: $BusinessOwnership = $this->BusinessOwnership->where('userID', session()->get('id')); in this case it does not work $BusinessOwnership - you must return one or more results with BusinessID, then extract information from BusinessProfile by id-> BusinessID
@Secux ,
(Using a join can be used in the Model) You can do what @nfaiz suggested by creating a more complex query. (Use this link https://codeigniter.com/user_guide/datab...cific-data. Then scroll up looking for $builder->join() ) OR You could create a view in the database that joins both tables then in CI call the database view with your parameters. (10-26-2021, 05:33 AM)php_rocs Wrote: @Secux , I found this solution. I don't know how correct and optimized it is PHP Code: $list_business = $this->BusinessOwnership->where('userID', session()->get('id'))->get()->getResult('array'); |
Welcome Guest, Not a member yet? Register Sign In |