Welcome Guest, Not a member yet? Register   Sign In
CI, MVC and m:n table-relationships
#6

[eluser]jedd[/eluser]
Btw, don't know if you're doing this for a particular reason, but your code:

Code:
function functionForTableB()
{
  $id = $this->uri->segment(3);
  $data['tableB'] = $this->model->b($id);
...

... can be written more conveniently as:
Code:
function functionForTableB ( $id = NULL)
{
   ...

Obviously you wrap some checks around the $id before you proceed (but I see you're not showing them on your uri-segment call anyway).

Oh, and use an id column in your third table.


Messages In This Thread
CI, MVC and m:n table-relationships - by El Forum - 06-08-2009, 05:45 PM
CI, MVC and m:n table-relationships - by El Forum - 06-08-2009, 05:56 PM
CI, MVC and m:n table-relationships - by El Forum - 06-08-2009, 08:29 PM
CI, MVC and m:n table-relationships - by El Forum - 06-08-2009, 08:50 PM
CI, MVC and m:n table-relationships - by El Forum - 06-08-2009, 08:56 PM
CI, MVC and m:n table-relationships - by El Forum - 06-09-2009, 06:23 AM
CI, MVC and m:n table-relationships - by El Forum - 06-09-2009, 07:28 AM
CI, MVC and m:n table-relationships - by El Forum - 06-09-2009, 10:02 AM
CI, MVC and m:n table-relationships - by El Forum - 06-09-2009, 10:36 AM
CI, MVC and m:n table-relationships - by El Forum - 06-09-2009, 11:31 AM
CI, MVC and m:n table-relationships - by El Forum - 06-09-2009, 12:00 PM
CI, MVC and m:n table-relationships - by El Forum - 06-09-2009, 02:13 PM
CI, MVC and m:n table-relationships - by El Forum - 06-10-2009, 05:30 AM
CI, MVC and m:n table-relationships - by El Forum - 06-10-2009, 06:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB