SQL join codeigniter 4 |
Codeigniter 4 is throwing the following error:
Argument 2 passed to view() must be of the type array, null given called in D:\xampp\htdocs\lordeCI\app\Controllers\Blog.php on line 35 That is about the block of code below: public function post($post_id) { $model = new BlogModel(); $posts = $model->select('*')->select('c1.nome as categoria, c2.nome as categoria_2') ->join('categorias c1', 'c1.categoria_id = posts.categoria', 'inner') ->join('categorias c2', 'c2.categoria_id = posts.categoria_2', 'inner') ->find($post_id); return view('posts/single_post',$posts); } I am very grateful to who echatspin echatrandom help me with that.
Check you SQL statement is correct:
dd($model->db->getLastQuery()); |
Welcome Guest, Not a member yet? Register Sign In |