⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Callback Column, help me



Alfandi Nurulmukhlis
  • profile picture
  • Member

Posted 29 October 2013 - 07:43 AM

Hello

i need help for my project

for example, i use database examples by GC

in table film, i add column "actor" where it's not available in database and i create column just for display data.
 

$crud->columns('title','release_year','rental_duration','rental_rate','length','replacement_cost','rating','last_update','category','actor');


i want display data from table film_actor and get actor_id where film.film_id=film_actor.film_id

my code :
 

$crud = new grocery_CRUD();
...
$crud->callback_column('actor',array($this,'_cb_actor'));
...
$this->_example_output($output);



function _cb_actor($value, $row)
{
    $actrs=$this->db->get('film_actor')->row()->actor_id;

    return $actrs;
}


but the result is display all data with the first row actor_id in table film_actor and all data is same

i want get actor_id  where film.film_id=film_actor.film_id

how can i do that?

please help me, sorry for bad english
thanks in advance