⚠ 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

How get values from column into my local variable



orainfra
  • profile picture
  • Member

Posted 03 March 2020 - 13:38 PM

$crud = new grocery_CRUD();
 
$crud->set_theme('datatables');
$crud->set_table('sales');
$crud->set_subject('sale');
$crud->required_fields('sales_id','date','customer_id');
$crud->columns('sales_id','customer_id','date','payment_mode','payment');
$crud->display_as('sales_id','Sales Id');
$crud->display_as('customer_id','Customer');
 
$crud->set_relation('customer_id','customer','customer_name');
 
$mode=' ';

 

// here is my local variable $mode and i want to get value of 'payment_mode'
// i want move value of 'payment_mode' into $mode

 


kevbo75217
  • profile picture
  • Member

Posted 01 April 2020 - 02:36 AM

Try

$mode = $row->payment_mode;

 

That should return the value.

Alot will also depend on what you are trying to do with the variable.