⚠ 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

Small problem



Tomislav
  • profile picture
  • Member

Posted 17 November 2013 - 12:08 PM

Hi, i have 2 tables, account and user.

 

Account

 

account_ID

user_ID_FK

acc_name

acc_type

 

User

user_ID

name

email

 

I need to display acc_name and acc_type from Account and insert user_ID_FK which i get from function get_users_data();

 

How can i accomplish inserting user_ID_FK without display to user? Here is my current function.

 

public function account()
    {
        $user_id = $this->main->get_users_data();
        $crud = new grocery_CRUD();
        $crud->where('user_ID_FK', $user_id['user_ID']);
        $crud->set_table('account');
        $crud->fields('acc_type', 'acc_name');
        $output = $crud->render();
        $this->_example_output($output);    
    }
 
Thanks, Tomislav