Converting SQL query into CodeIgniter format query |
Currently I have 2 tables in my mysql database and I'm comparing my entries in both those tables to get an output. The output is correct when placed as a query in mysql. Now I want to convert it to CodeIgniter format code. I don't want to use the $this->db->query() operator for this.
The following is my query: Code: with X as (
@JJM50 ,
What version of CI are you using (CI 3.x or 4.x)? Also, more then likely you will have to use some form of $this->db->query() but CI gives you options that makes it easier. Query binding for CI 4.x https://codeigniter.com/user_guide/datab...ight=query Query binding for CI 3.x https://codeigniter.com/userguide3/datab...y-bindings Also, keep in mind that you could create your query as a MySQL view which would allow you to have a simpler query in CI. |
Welcome Guest, Not a member yet? Register Sign In |